Add funktion to make easy shell builders

This commit is contained in:
clerie 2023-06-27 19:13:04 +02:00
parent 4f8283f4b9
commit 66092a4f08

View File

@ -40,4 +40,26 @@ in rec {
passAsFile = [ "buildscript" ];
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
'';
};
}