about summary refs log tree commit diff
path: root/corepkgs/config.nix.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-24T10·15+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-24T10·15+0100
commit6f0c6e20e03bc82fcf0d2198cf81fa2cf25c2f6c (patch)
tree0037f8a7f72bb2c0fd5cb89e8c37c03d1c8c8ebf /corepkgs/config.nix.in
parentb005e63ccf387add426aa9941ab9f5770307fe33 (diff)
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.
Diffstat (limited to 'corepkgs/config.nix.in')
-rw-r--r--corepkgs/config.nix.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/corepkgs/config.nix.in b/corepkgs/config.nix.in
index a5ec83b9ea0c..8918f4ddde8d 100644
--- a/corepkgs/config.nix.in
+++ b/corepkgs/config.nix.in
@@ -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
+      [ ];
 }