2024-11-07 14:46:37 +02:00
|
|
|
with import "${builtins.getEnv "_NIX_TEST_BUILD_DIR"}/config.nix";
|
2017-11-11 00:51:34 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
input = import ./simple.nix;
|
|
|
|
|
|
|
|
dependent = mkDerivation {
|
|
|
|
name = "dependent";
|
2022-11-14 16:13:46 +02:00
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out
|
|
|
|
echo -n "$input1" > "$out/file1"
|
|
|
|
echo -n "$input2" > "$out/file2"
|
|
|
|
'';
|
|
|
|
input1 = "${input}/hello";
|
|
|
|
input2 = "hello";
|
2017-11-11 00:51:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
readDependent = mkDerivation {
|
2022-11-14 16:13:46 +02:00
|
|
|
# Will evaluate correctly because file2 doesn't have any references,
|
|
|
|
# even though the `dependent` derivation does.
|
|
|
|
name = builtins.readFile (dependent + "/file2");
|
|
|
|
buildCommand = ''
|
|
|
|
echo "$input" > "$out"
|
|
|
|
'';
|
|
|
|
input = builtins.readFile (dependent + "/file1");
|
2017-11-11 00:51:34 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
in readDependent
|