A tool to simplify the management of Nix development environments by caching environments defined by shell.nix files.
By keeping symlinks to derivation and the build output, the environment will not be garbage collected by nix-collect-garbage.
It supports features like garbage collection to clean up stale environments.
git clone https://git.stha.de/stefan/nix-dev.git
nix-env -i -f nix-dev/package.nixBasic usage:
Run in a directory with shell.nix:
nix-devSpecify a different shell file:
nix-dev my-shell.nixForce environment recreation:
nix-dev --break-cacheClean up environments:
nix-dev --collect-garbageFor more options, run:
nix-dev --help- Caches environments based on
shell.nixcontent for quick reuse. - Prevents
nix-collect-garbagefrom deleting the environment. - Automatically cleans up stale environments.