24 lines
257 B
Nix
24 lines
257 B
Nix
|
{
|
||
|
stdenv
|
||
|
}:
|
||
|
|
||
|
{
|
||
|
script
|
||
|
, shell ? "/bin/sh"
|
||
|
}:
|
||
|
|
||
|
stdenv.mkDerivation {
|
||
|
name = "script";
|
||
|
preferLocalBuild = true;
|
||
|
phases = [ "installPhase" ];
|
||
|
installPhase = ''
|
||
|
cat > $out <<'EOF'
|
||
|
#!${shell}
|
||
|
|
||
|
${script}
|
||
|
|
||
|
EOF
|
||
|
chmod +x $out
|
||
|
'';
|
||
|
}
|