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:
parent
29e1ff675b
commit
a70d275f3d
4 changed files with 55 additions and 5 deletions
|
@ -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
17
tests/pass-as-file.sh
Normal 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
|
||||
'';
|
||||
}
|
||||
")
|
Loading…
Add table
Add a link
Reference in a new issue