2021-06-15 10:11:31 +00: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 17:11:55 +00:00
|
|
|
rec {
|
2019-03-27 22:49:14 +00:00
|
|
|
shell = "@bash@";
|
2013-11-25 17:47:03 +00:00
|
|
|
|
2024-10-25 11:19:52 +00:00
|
|
|
path = "@ls@";
|
2009-03-17 17:11:55 +00:00
|
|
|
|
2020-03-24 13:26:13 +00:00
|
|
|
system = "@system@";
|
2009-03-17 17:11:55 +00:00
|
|
|
|
2013-11-25 17:47:03 +00:00
|
|
|
shared = builtins.getEnv "_NIX_TEST_SHARED";
|
2009-03-17 17:11:55 +00:00
|
|
|
|
2009-03-17 16:33:48 +00:00
|
|
|
mkDerivation = args:
|
|
|
|
derivation ({
|
2009-03-17 17:11:55 +00:00
|
|
|
inherit system;
|
|
|
|
builder = shell;
|
2024-03-07 09:46:47 +00: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 17:11:55 +00:00
|
|
|
PATH = path;
|
2021-06-23 15:36:50 +00:00
|
|
|
} // caArgs // removeAttrs args ["builder" "meta"])
|
2012-01-03 01:51:38 +00:00
|
|
|
// { meta = args.meta or {}; };
|
2021-06-23 15:36:50 +00:00
|
|
|
}
|