mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Support fixed-output derivations depending on impure derivations
This commit is contained in:
parent
5cd72598fe
commit
18935e8b9f
4 changed files with 48 additions and 9 deletions
|
@ -7,6 +7,7 @@ rec {
|
|||
outputs = [ "out" "stuff" ];
|
||||
buildCommand =
|
||||
''
|
||||
echo impure
|
||||
x=$(< $TEST_ROOT/counter)
|
||||
mkdir $out $stuff
|
||||
echo $x > $out/n
|
||||
|
@ -23,6 +24,7 @@ rec {
|
|||
name = "impure-on-impure";
|
||||
buildCommand =
|
||||
''
|
||||
echo impure-on-impure
|
||||
x=$(< ${impure}/n)
|
||||
mkdir $out
|
||||
printf X$x > $out/n
|
||||
|
@ -43,4 +45,24 @@ rec {
|
|||
'';
|
||||
};
|
||||
|
||||
contentAddressed = mkDerivation {
|
||||
name = "content-addressed";
|
||||
buildCommand =
|
||||
''
|
||||
echo content-addressed
|
||||
x=$(< ${impureOnImpure}/n)
|
||||
printf ''${x:0:1} > $out
|
||||
'';
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = "sha256-eBYxcgkuWuiqs4cKNgKwkb3vY/HR0vVsJnqe8itJGcQ=";
|
||||
};
|
||||
|
||||
inputAddressedAfterCA = mkDerivation {
|
||||
name = "input-addressed-after-ca";
|
||||
buildCommand =
|
||||
''
|
||||
cat ${contentAddressed} > $out
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue