diff options
Diffstat (limited to 'tests/functional/config.nix.in')
-rw-r--r-- | tests/functional/config.nix.in | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/functional/config.nix.in b/tests/functional/config.nix.in new file mode 100644 index 000000000..7facbdcbc --- /dev/null +++ b/tests/functional/config.nix.in @@ -0,0 +1,27 @@ +let + contentAddressedByDefault = builtins.getEnv "NIX_TESTS_CA_BY_DEFAULT" == "1"; + caArgs = if contentAddressedByDefault then { + __contentAddressed = true; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + } else {}; +in + +rec { + shell = "@bash@"; + + path = "@coreutils@"; + + system = "@system@"; + + shared = builtins.getEnv "_NIX_TEST_SHARED"; + + mkDerivation = args: + derivation ({ + inherit system; + builder = shell; + args = ["-e" args.builder or (builtins.toFile "builder-${args.name}.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")]; + PATH = path; + } // caArgs // removeAttrs args ["builder" "meta"]) + // { meta = args.meta or {}; }; +} |