forked from lix-project/lix
![John Ericson](/assets/img/avatar_default.png)
This seems more correct. It also means one can specify the features a store should support with --store and remote-store=..., which is useful. I use this to clean up the build remotes test.
41 lines
897 B
Nix
41 lines
897 B
Nix
{ 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 {
|
|
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"];
|
|
};
|
|
|
|
in
|
|
|
|
mkDerivation {
|
|
shell = busybox;
|
|
name = "build-remote";
|
|
buildCommand =
|
|
''
|
|
read x < ${input1}
|
|
read y < ${input2}
|
|
echo "$x $y" > $out
|
|
'';
|
|
}
|