diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index f28a793aefc6..d3acc625a8b2 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 <