From 66092a4f081c4adc2bfe7e469e26fadb67739a4d Mon Sep 17 00:00:00 2001 From: clerie Date: Tue, 27 Jun 2023 19:13:04 +0200 Subject: [PATCH] Add funktion to make easy shell builders --- busybox.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/busybox.nix b/busybox.nix index ec06e33..575c904 100644 --- a/busybox.nix +++ b/busybox.nix @@ -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 + ''; + }; }