diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-06-30 12:21:45 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-06-30 12:21:45 -0600 |
commit | ddb81ca126864dbf920472688bcd3a80c7a7e73b (patch) | |
tree | d8152008a1741eb4029cfd7f03618ad28eb6df93 /tests/build-hook.nix | |
parent | c484a67914fe16c4f2f6e7779baf4bdfe6405a22 (diff) | |
parent | ee1582494e458bf83535986b2a5bca32687420c5 (diff) |
Merge branch 'master' into add-trace
Diffstat (limited to 'tests/build-hook.nix')
-rw-r--r-- | tests/build-hook.nix | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/build-hook.nix b/tests/build-hook.nix index 8c5ca8cd3..a19c10dde 100644 --- a/tests/build-hook.nix +++ b/tests/build-hook.nix @@ -1,23 +1,39 @@ +{ 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\"")]; + } // removeAttrs args ["builder" "meta"]) + // { meta = args.meta or {}; }; + input1 = mkDerivation { - name = "build-hook-input-1"; - buildCommand = "mkdir $out; echo FOO > $out/foo"; + shell = busybox; + name = "build-remote-input-1"; + buildCommand = "echo FOO > $out"; requiredSystemFeatures = ["foo"]; }; input2 = mkDerivation { - name = "build-hook-input-2"; - buildCommand = "mkdir $out; echo BAR > $out/bar"; + shell = busybox; + name = "build-remote-input-2"; + buildCommand = "echo BAR > $out"; }; in mkDerivation { - name = "build-hook"; - builder = ./dependencies.builder0.sh; - input1 = " " + input1 + "/."; - input2 = " ${input2}/."; + shell = busybox; + name = "build-remote"; + buildCommand = + '' + read x < ${input1} + read y < ${input2} + echo $x$y > $out + ''; } |