we don't remove the entire feature in one go to make review easier. impure derivations are rather unintrusive on their own, at least if we compare them to dynamic or ca derivations in general, so we will be done with this soon. as it stands impure derivations cannot work without ca derivations, and those we *really* want to leave behind. Change-Id: I4f01d8d758b2c85dcd6c3078304b5ee1b52f65b0
48 lines
983 B
Nix
48 lines
983 B
Nix
with import ./config.nix;
|
|
|
|
rec {
|
|
|
|
impureOnImpure = mkDerivation {
|
|
name = "impure-on-impure";
|
|
buildCommand =
|
|
''
|
|
echo impure-on-impure
|
|
x=$(< ${impure}/n)
|
|
mkdir $out
|
|
printf X$x > $out/n
|
|
ln -s ${impure.stuff} $out/symlink
|
|
ln -s $out $out/self
|
|
'';
|
|
__impure = true;
|
|
};
|
|
|
|
# This is not allowed.
|
|
inputAddressed = mkDerivation {
|
|
name = "input-addressed";
|
|
buildCommand =
|
|
''
|
|
cat ${impure} > $out
|
|
'';
|
|
};
|
|
|
|
contentAddressed = mkDerivation {
|
|
name = "content-addressed";
|
|
buildCommand =
|
|
''
|
|
echo content-addressed
|
|
x=$(< ${impureOnImpure}/n)
|
|
printf ''${x:0:1} > $out
|
|
'';
|
|
outputHashMode = "recursive";
|
|
outputHash = "sha256-eBYxcgkuWuiqs4cKNgKwkb3vY/HR0vVsJnqe8itJGcQ=";
|
|
};
|
|
|
|
inputAddressedAfterCA = mkDerivation {
|
|
name = "input-addressed-after-ca";
|
|
buildCommand =
|
|
''
|
|
cat ${contentAddressed} > $out
|
|
'';
|
|
};
|
|
}
|