Experiments using Nix to manage project toolchains.
This project uses Nix and Nix Flakes to manage toolchains. If you don't have Nix installed, you can install it using the Determinate Systems installer:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
In a project that needs a toolchain, add flake.nix
{
description = "A Java/Gradle Project";
inputs = {
bitso.url = "github:bitsoex/nix-toolchain";
};
outputs =
{ bitso, ... }:
bitso.lib.mkProject {
java = {
enable = true;
version = "17";
gradle.enable = true;
};
redis.enable = true;
};
}
Then to get a shell run nix develop
. By default, Nix shells use bash
. If you want zsh
, you can run nix develop -c zsh
.