Add funktion to make easy shell builders
This commit is contained in:
parent
4f8283f4b9
commit
66092a4f08
22
busybox.nix
22
busybox.nix
@ -40,4 +40,26 @@ in rec {
|
|||||||
passAsFile = [ "buildscript" ];
|
passAsFile = [ "buildscript" ];
|
||||||
args = [ "sh" "-c" "${busybox}/busybox sh $buildscriptPath" ];
|
args = [ "sh" "-c" "${busybox}/busybox sh $buildscriptPath" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
shellDerivation = { name
|
||||||
|
, buildscript
|
||||||
|
}: builtins.derivation {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
inherit name;
|
||||||
|
builder = utils + /sh;
|
||||||
|
shellenvironment = ''
|
||||||
|
export PATH=${utils}
|
||||||
|
sh $buildscriptPath
|
||||||
|
'';
|
||||||
|
inherit buildscript;
|
||||||
|
passAsFile = [ "shellenvironment" "buildscript" ];
|
||||||
|
args = [ "-c" "${utils}/sh $shellenvironmentPath" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
test = shellDerivation {
|
||||||
|
name = "test";
|
||||||
|
buildscript = ''
|
||||||
|
w > $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user