sheenobu dot net

2021-03-01 - NixOS - Persistent shell packages

Persist nix-shell packages by listing each reference in the derivatation and linking it locally. This links each dependency separately under .deps.d/.

found via mailing list https://releases.nixos.org/nix-dev/2016-November/022173.html

nix-instantiate --quiet --no-build-output ./shell.nix --indirect --add-root $PWD/shell.drv
nix-store -r $(nix-store --query --references $PWD/shell.drv) --indirect --add-root $PWD/.deps.d/shell