writeOut: don't modify stdenv's shell

This fixes following (and maybe more) issues:
- /nix/store/*-stdenv/setup: line 125: showBuildStats: unbound variable
- /nix/store/*-stdenv/setup: line 69: !hookName: unbound variable
This commit is contained in:
tv 2017-07-25 12:32:37 +02:00
parent a1cdec85d6
commit c5fef87af8

View File

@ -144,9 +144,14 @@ with import <stockholm/lib>;
env = filevars // { passAsFile = attrNames filevars; };
in
# Use a subshell because <nixpkgs/stdenv/generic/setup.sh>'s genericBuild
# sources (or evaluates) the buildCommand and we don't want to modify its
# shell. In particular, exitHandler breaks in multiple ways with set -u.
pkgs.runCommand name env /* sh */ ''
set -efu
${concatMapStringsSep "\n" (getAttr "install") files}
(
set -efu
${concatMapStringsSep "\n" (getAttr "install") files}
)
'';
writeHaskell =