I'm building a nixos vm using nixos-shell and I'm using the following to add the dependencies of a example project to the vm:

 let appRepo = pkgs.callPackage (builtins.fetchGit { url = "/home/chris/NewProjects/Example"; rev = "95f6b51548163dd999c945e5f417bd551d9ed49f"; }) {}; in environment.systemPackages = [ pkgs.docker pkgs.vim pkgs.git pkgs.htop pkgs.ripgrep ] ++ [ (pkgs.callPackage hdev {}) ] ++ (appRepo.env); ## this line here 

This avoids the need to download dependencies of the example project. However it has the side effect of polluting the global $PATH / system packages.

Is there a cleaner way to add these dependencies in without this side effect?

1 Reply 1

https://discourse.nixos.org/t/how-to-declaratively-keep-packages-in-store-without-adding-them-to-environment-systempackages/13538

system.extraDependencies

A list of paths that should be included in the system closure but generally not visible to users.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.