2021-06-15 12:11:31 +02:00
|
|
|
let
|
|
|
|
contentAddressedByDefault = builtins.getEnv "NIX_TESTS_CA_BY_DEFAULT" == "1";
|
|
|
|
caArgs = if contentAddressedByDefault then {
|
|
|
|
__contentAddressed = true;
|
|
|
|
outputHashMode = "recursive";
|
|
|
|
outputHashAlgo = "sha256";
|
|
|
|
} else {};
|
|
|
|
in
|
|
|
|
|
2009-03-17 18:11:55 +01:00
|
|
|
rec {
|
2019-03-27 23:49:14 +01:00
|
|
|
shell = "@bash@";
|
2013-11-25 18:47:03 +01:00
|
|
|
|
2019-03-27 23:49:14 +01:00
|
|
|
path = "@coreutils@";
|
2009-03-17 18:11:55 +01:00
|
|
|
|
2020-03-24 14:26:13 +01:00
|
|
|
system = "@system@";
|
2009-03-17 18:11:55 +01:00
|
|
|
|
2013-11-25 18:47:03 +01:00
|
|
|
shared = builtins.getEnv "_NIX_TEST_SHARED";
|
2009-03-17 18:11:55 +01:00
|
|
|
|
2009-03-17 17:33:48 +01:00
|
|
|
mkDerivation = args:
|
|
|
|
derivation ({
|
2009-03-17 18:11:55 +01:00
|
|
|
inherit system;
|
|
|
|
builder = shell;
|
2024-03-07 10:46:47 +01:00
|
|
|
args = ["-e" args.builder or (builtins.toFile "builder-${args.name}.sh" ''
|
|
|
|
if [ -e "$NIX_ATTRS_SH_FILE" ]; then source $NIX_ATTRS_SH_FILE; fi;
|
|
|
|
eval "$buildCommand"
|
|
|
|
'')];
|
2009-03-17 18:11:55 +01:00
|
|
|
PATH = path;
|
2021-06-23 17:36:50 +02:00
|
|
|
} // caArgs // removeAttrs args ["builder" "meta"])
|
2012-01-03 02:51:38 +01:00
|
|
|
// { meta = args.meta or {}; };
|
2021-06-23 17:36:50 +02:00
|
|
|
}
|