mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 06:56:14 +02:00
6f0c6e20e0
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.
27 lines
676 B
Nix
27 lines
676 B
Nix
let
|
|
fromEnv = var: def:
|
|
let val = builtins.getEnv var; in
|
|
if val != "" then val else def;
|
|
in rec {
|
|
perl = "@perl@";
|
|
shell = "@bash@";
|
|
coreutils = "@coreutils@";
|
|
bzip2 = "@bzip2@";
|
|
gzip = "@gzip@";
|
|
xz = "@xz@";
|
|
tar = "@tar@";
|
|
tarFlags = "@tarFlags@";
|
|
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
|
|
[ ];
|
|
}
|