Created
December 5, 2022 21:38
-
-
Save phaer/355640e192321aecd5406dea67a74ff2 to your computer and use it in GitHub Desktop.
nix: writeScript without stdenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ name ? "hello" | |
, text ? "echo 'Hello World'" | |
, pkgs ? import <nixpkgs> {} | |
}: | |
builtins.derivation { | |
inherit name; | |
inherit (pkgs) system; | |
builder = "${pkgs.busybox}/bin/busybox"; | |
args = [ | |
"sh" | |
"-c" | |
'' | |
echo "${text}" > $out | |
$builder chmod +x $out | |
'' | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment