2020-06-25 19:26:34 +03:00
|
|
|
{ busybox }:
|
|
|
|
|
2009-03-17 19:11:55 +02:00
|
|
|
with import ./config.nix;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2020-06-25 19:26:34 +03:00
|
|
|
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 {}; };
|
|
|
|
|
2009-03-17 19:11:55 +02:00
|
|
|
input1 = mkDerivation {
|
2020-06-25 19:26:34 +03:00
|
|
|
shell = busybox;
|
|
|
|
name = "build-remote-input-1";
|
|
|
|
buildCommand = "echo FOO > $out";
|
2017-05-02 16:35:35 +03:00
|
|
|
requiredSystemFeatures = ["foo"];
|
2009-03-17 19:11:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
input2 = mkDerivation {
|
2020-06-25 19:26:34 +03:00
|
|
|
shell = busybox;
|
|
|
|
name = "build-remote-input-2";
|
|
|
|
buildCommand = "echo BAR > $out";
|
2020-08-12 19:32:36 +03:00
|
|
|
requiredSystemFeatures = ["bar"];
|
2009-03-17 19:11:55 +02:00
|
|
|
};
|
|
|
|
|
2020-08-12 16:24:39 +03:00
|
|
|
input3 = mkDerivation {
|
|
|
|
shell = busybox;
|
|
|
|
name = "build-remote-input-3";
|
|
|
|
buildCommand = ''
|
|
|
|
read x < ${input2}
|
|
|
|
echo $x BAZ > $out
|
|
|
|
'';
|
|
|
|
requiredSystemFeatures = ["baz"];
|
|
|
|
};
|
|
|
|
|
2009-03-17 19:11:55 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
mkDerivation {
|
2020-06-25 19:26:34 +03:00
|
|
|
shell = busybox;
|
|
|
|
name = "build-remote";
|
|
|
|
buildCommand =
|
|
|
|
''
|
|
|
|
read x < ${input1}
|
2020-08-12 16:24:39 +03:00
|
|
|
read y < ${input3}
|
2020-08-12 19:32:36 +03:00
|
|
|
echo "$x $y" > $out
|
2020-06-25 19:26:34 +03:00
|
|
|
'';
|
2009-03-17 19:11:55 +02:00
|
|
|
}
|