mirror of
https://github.com/NixOS/nix
synced 2025-07-07 01:51:47 +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
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