aboutsummaryrefslogtreecommitdiff
path: root/tests/build-hook.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tests/build-hook.nix')
-rw-r--r--tests/build-hook.nix32
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
+ '';
}