Preventing nix-env -i from installing $out/lib in the user-environment

126 Views Asked by At

Is it possible to prevent the contents of lib/ in a derivation from getting installed in the active user-environment? The package in question has an internal lib/ folder which should not be exposed to users, nor clutter the environment. As far as I have been able to discern, the links in user-environment are updated from within the nix-env binary.

1

There are 1 best solutions below

0
On BEST ANSWER

I found a solution. Instead of installing in $out, one can install in $out/pkg, and then create the appropriate links in $out. This prevents nix-env from finding lib/ (amongst other things).