diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-04-05 19:06:30 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-04-05 19:06:30 -0400 |
commit | cdc9f34a44aacbc8dbfa232a7620531a689d9c43 (patch) | |
tree | 11984c860dbc5c64bb2443737167f5ed4c1d1595 /tests/build-hook-ca-floating.nix | |
parent | 7863036634ccb07e1933cd0b106fc27d5c073004 (diff) | |
parent | e12308dd63f0ad27b22dcdb3da89c411eebcad2b (diff) |
Merge commit 'e12308dd63f0ad27b22dcdb3da89c411eebcad2b' into ca-drv-exotic
Diffstat (limited to 'tests/build-hook-ca-floating.nix')
-rw-r--r-- | tests/build-hook-ca-floating.nix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/build-hook-ca-floating.nix b/tests/build-hook-ca-floating.nix new file mode 100644 index 000000000..67295985f --- /dev/null +++ b/tests/build-hook-ca-floating.nix @@ -0,0 +1,53 @@ +{ busybox }: + +with import ./config.nix; + +let + + mkDerivation = args: + derivation ({ + inherit system; + builder = busybox; + args = ["sh" "-e" args.builder or (builtins.toFile "builder-${args.name}.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")]; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + __contentAddressed = true; + } // removeAttrs args ["builder" "meta"]) + // { meta = args.meta or {}; }; + + input1 = mkDerivation { + shell = busybox; + name = "build-remote-input-1"; + buildCommand = "echo FOO > $out"; + requiredSystemFeatures = ["foo"]; + }; + + input2 = mkDerivation { + shell = busybox; + name = "build-remote-input-2"; + buildCommand = "echo BAR > $out"; + requiredSystemFeatures = ["bar"]; + }; + + input3 = mkDerivation { + shell = busybox; + name = "build-remote-input-3"; + buildCommand = '' + read x < ${input2} + echo $x BAZ > $out + ''; + requiredSystemFeatures = ["baz"]; + }; + +in + + mkDerivation { + shell = busybox; + name = "build-remote"; + buildCommand = + '' + read x < ${input1} + read y < ${input3} + echo "$x $y" > $out + ''; + } |