2021-06-15 06:11:31 -04: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 13:11:55 -04:00
|
|
|
rec {
|
2019-03-27 18:49:14 -04:00
|
|
|
shell = "@bash@";
|
2013-11-25 12:47:03 -05:00
|
|
|
|
2019-03-27 18:49:14 -04:00
|
|
|
path = "@coreutils@";
|
2009-03-17 13:11:55 -04:00
|
|
|
|
2020-03-24 09:26:13 -04:00
|
|
|
system = "@system@";
|
2009-03-17 13:11:55 -04:00
|
|
|
|
2013-11-25 12:47:03 -05:00
|
|
|
shared = builtins.getEnv "_NIX_TEST_SHARED";
|
2009-03-17 13:11:55 -04:00
|
|
|
|
2009-03-17 12:33:48 -04:00
|
|
|
mkDerivation = args:
|
|
|
|
derivation ({
|
2009-03-17 13:11:55 -04:00
|
|
|
inherit system;
|
|
|
|
builder = shell;
|
2020-05-12 07:49:55 -04:00
|
|
|
args = ["-e" args.builder or (builtins.toFile "builder-${args.name}.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")];
|
2009-03-17 13:11:55 -04:00
|
|
|
PATH = path;
|
2021-06-23 11:36:50 -04:00
|
|
|
} // caArgs // removeAttrs args ["builder" "meta"])
|
2012-01-02 20:51:38 -05:00
|
|
|
// { meta = args.meta or {}; };
|
2021-06-23 11:36:50 -04:00
|
|
|
}
|