Don't rely on __noChroot for corepkgs

This doesn't work anymore if the "strict" chroot mode is
enabled. Instead, add Nix's store path as a dependency. This ensures
that its closure is present in the chroot.
This commit is contained in:
Eelco Dolstra 2015-03-24 11:15:45 +01:00
parent b005e63ccf
commit 6f0c6e20e0
6 changed files with 24 additions and 15 deletions

View file

@ -2,7 +2,7 @@ let
fromEnv = var: def:
let val = builtins.getEnv var; in
if val != "" then val else def;
in {
in rec {
perl = "@perl@";
shell = "@bash@";
coreutils = "@coreutils@";
@ -14,4 +14,14 @@ in {
tr = "@tr@";
curl = "@curl@";
nixBinDir = fromEnv "NIX_BIN_DIR" "@bindir@";
nixPrefix = "@prefix@";
# If Nix is installed in the Nix store, then automatically add it as
# a dependency to the core packages. This ensures that they work
# properly in a chroot.
chrootDeps =
if dirOf nixPrefix == builtins.storeDir then
[ (builtins.storePath nixPrefix) ]
else
[ ];
}