tweag / nix-ux

Nix UX improvements
36 stars 2 forks source link

nix develop: Set $out to a writable location #8

Closed edolstra closed 4 years ago

edolstra commented 4 years ago

Currently $out (and other environment variables corresponding to outputs) point to a non-existant, non-writable location in the Nix store. Thus commands like make install don't work. Some packages work around this by doing stuff like:

          shellHook =
            ''
              export prefix=$(pwd)/inst
              configureFlags+=" --prefix=$prefix"
              PKG_CONFIG_PATH=$prefix/lib/pkgconfig:$PKG_CONFIG_PATH
              PATH=$prefix/bin:$PATH
            ";

We should make $out point to a writable location by default. The question is what it should be. It should be persistent across nix develop invocations and per-project, so maybe something like $(pwd)/outputs/$outputName.

edolstra commented 4 years ago

Implemented in https://github.com/NixOS/nix/commit/3156560d413634eea170e8dd88b3c2208149d999.