mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Now, both the unit and functional tests relating to derivation options are tested both ways -- with input addressing and content-addressing derivations.
62 lines
1.1 KiB
Nix
62 lines
1.1 KiB
Nix
{ contentAddress }:
|
|
|
|
let
|
|
caArgs =
|
|
if contentAddress then
|
|
{
|
|
__contentAddressed = true;
|
|
outputHashMode = "recursive";
|
|
outputHashAlgo = "sha256";
|
|
}
|
|
else
|
|
{ };
|
|
|
|
derivation' = args: derivation (caArgs // args);
|
|
|
|
system = "my-system";
|
|
|
|
foo = derivation' {
|
|
inherit system;
|
|
name = "foo";
|
|
builder = "/bin/bash";
|
|
args = [
|
|
"-c"
|
|
"echo foo > $out"
|
|
];
|
|
};
|
|
|
|
bar = derivation' {
|
|
inherit system;
|
|
name = "bar";
|
|
builder = "/bin/bash";
|
|
args = [
|
|
"-c"
|
|
"echo bar > $out"
|
|
];
|
|
};
|
|
|
|
in
|
|
derivation' {
|
|
inherit system;
|
|
name = "advanced-attributes";
|
|
builder = "/bin/bash";
|
|
args = [
|
|
"-c"
|
|
"echo hello > $out"
|
|
];
|
|
__sandboxProfile = "sandcastle";
|
|
__noChroot = true;
|
|
__impureHostDeps = [ "/usr/bin/ditto" ];
|
|
impureEnvVars = [ "UNICORN" ];
|
|
__darwinAllowLocalNetworking = true;
|
|
allowedReferences = [ foo ];
|
|
allowedRequisites = [ foo ];
|
|
disallowedReferences = [ bar ];
|
|
disallowedRequisites = [ bar ];
|
|
requiredSystemFeatures = [
|
|
"rainbow"
|
|
"uid-range"
|
|
];
|
|
preferLocalBuild = true;
|
|
allowSubstitutes = false;
|
|
}
|