mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
* New primop: builtins.toFile, which writes a string into the store
and returns its path. This can be used to (for instance) write builders inside a Nix expression, e.g., stdenv.mkDerivation { builder = " source $stdenv/setup ... "; ... }
This commit is contained in:
parent
de90fdf908
commit
7974aae81c
2 changed files with 36 additions and 6 deletions
|
@ -1,7 +1,23 @@
|
|||
derivation {
|
||||
name = "gc-runtime";
|
||||
system = "@system@";
|
||||
builder = "@shell@";
|
||||
args = ["-e" "-x" ./gc-runtime.builder.sh];
|
||||
PATH = "@testPath@";
|
||||
let {
|
||||
|
||||
# Test inline source file definitions.
|
||||
builder = builtins.toFile "
|
||||
mkdir $out
|
||||
|
||||
cat > $out/program <<EOF
|
||||
#! $SHELL
|
||||
sleep 10000
|
||||
EOF
|
||||
|
||||
chmod +x $out/program
|
||||
";
|
||||
|
||||
body = derivation {
|
||||
name = "gc-runtime";
|
||||
system = "@system@";
|
||||
builder = "@shell@";
|
||||
args = ["-e" "-x" builder];
|
||||
PATH = "@testPath@";
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue