From be3d498b1891339ffceb3f54f749d3d5fa343429 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 19 Jul 2013 11:21:05 -0400 Subject: [PATCH] Allow specifying packages whose closures should be in the chroot Signed-off-by: Shea Levy --- modules/services/misc/nix-daemon.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index f28a793aefc..d3acc625a8b 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -29,10 +29,12 @@ let # other paths in the store, we need the closure of /bin/sh # in `build-chroot-dirs' - otherwise any builder that uses # /bin/sh won't work. - binshDeps = pkgs.writeReferencesToFile config.system.build.binsh; + closureFile = pkgs.runCommand "closure" { + exportReferencesGraph = concatMap (pkg: [ "closure${baseNameOf pkg}" pkg ]) cfg.chrootClosures; + } "cat closure* | sort | uniq > $out"; in pkgs.runCommand "nix.conf" {extraOptions = cfg.extraOptions; } '' - extraPaths=$(for i in $(cat ${binshDeps}); do if test -d $i; then echo $i; fi; done) + extraPaths=$(for i in $(cat ${closureFile}); do if test -e $i; then echo $i; fi; done) cat > $out <