* Make nix-channel and nix-env work when chroots are enabled.
Author: eelco @ rev 14271 svn path=/nixos/branches/fix-style/; revision=14443
This commit is contained in:
parent
221680936e
commit
08f32ca62a
@ -190,16 +190,22 @@ in
|
|||||||
# other paths in the store, we need the closure of /bin/sh
|
# other paths in the store, we need the closure of /bin/sh
|
||||||
# in `build-chroot-dirs' - otherwise any builder that uses
|
# in `build-chroot-dirs' - otherwise any builder that uses
|
||||||
# /bin/sh won't work.
|
# /bin/sh won't work.
|
||||||
refs = pkgs.writeReferencesToFile binsh;
|
binshDeps = pkgs.writeReferencesToFile binsh;
|
||||||
|
|
||||||
|
# Likewise, if chroots are turned on, we need Nix's own
|
||||||
|
# closure in the chroot. Otherwise nix-channel and nix-env
|
||||||
|
# won't work because the dependencies of its builders (like
|
||||||
|
# coreutils and Perl) aren't visible. Sigh.
|
||||||
|
nixDeps = pkgs.writeReferencesToFile config.environment.nix;
|
||||||
in
|
in
|
||||||
pkgs.runCommand "nix.conf" {} ''
|
pkgs.runCommand "nix.conf" {} ''
|
||||||
binshDeps=$(for i in $(cat ${refs}); do if test -d $i; then echo $i; fi; done)
|
extraPaths=$(for i in $(cat ${binshDeps} ${nixDeps}); do if test -d $i; then echo $i; fi; done)
|
||||||
cat > $out <<END
|
cat > $out <<END
|
||||||
# WARNING: this file is generated.
|
# WARNING: this file is generated.
|
||||||
build-users-group = nixbld
|
build-users-group = nixbld
|
||||||
build-max-jobs = ${toString (config.nix.maxJobs)}
|
build-max-jobs = ${toString (config.nix.maxJobs)}
|
||||||
build-use-chroot = ${if config.nix.useChroot then "true" else "false"}
|
build-use-chroot = ${if config.nix.useChroot then "true" else "false"}
|
||||||
build-chroot-dirs = /dev /dev/pts /proc /bin $(echo $binshDeps)
|
build-chroot-dirs = /dev /dev/pts /proc /bin $(echo $extraPaths)
|
||||||
${config.nix.extraOptions}
|
${config.nix.extraOptions}
|
||||||
END
|
END
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user