1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

Allow passing attributes via files instead of environment variables

Closes #473.
This commit is contained in:
Eelco Dolstra 2015-02-17 14:42:15 +01:00
parent 29e1ff675b
commit a70d275f3d
4 changed files with 55 additions and 5 deletions

View file

@ -11,7 +11,7 @@ nix_tests = \
binary-patching.sh timeout.sh secure-drv-outputs.sh nix-channel.sh \
multiple-outputs.sh import-derivation.sh fetchurl.sh optimise-store.sh \
binary-cache.sh nix-profile.sh repair.sh dump-db.sh case-hack.sh \
check-reqs.sh
check-reqs.sh pass-as-file.sh
# parallel.sh
install-tests += $(foreach x, $(nix_tests), tests/$(x))

17
tests/pass-as-file.sh Normal file
View file

@ -0,0 +1,17 @@
source common.sh
clearStore
outPath=$(nix-build --no-out-link -E "
with import ./config.nix;
mkDerivation {
name = \"pass-as-file\";
passAsFile = [ \"foo\" ];
foo = [ \"xyzzy\" ];
builder = builtins.toFile \"builder.sh\" ''
[ \"\$(cat \$foo)\" = xyzzy ]
touch \$out
'';
}
")