Add script stage

This commit is contained in:
Rodrigo Arias 2021-01-12 18:19:49 +01:00
parent aeac1a6068
commit 2b9c3da911
2 changed files with 24 additions and 0 deletions

View File

@ -72,6 +72,7 @@
srun = callPackage ./stages/srun.nix { }; srun = callPackage ./stages/srun.nix { };
control = callPackage ./stages/control.nix { }; control = callPackage ./stages/control.nix { };
exec = callPackage ./stages/exec.nix { }; exec = callPackage ./stages/exec.nix { };
script = callPackage ./stages/script.nix { };
extrae = callPackage ./stages/extrae.nix { }; extrae = callPackage ./stages/extrae.nix { };
valgrind = callPackage ./stages/valgrind.nix { }; valgrind = callPackage ./stages/valgrind.nix { };
perf = callPackage ./stages/perf.nix { }; perf = callPackage ./stages/perf.nix { };

23
garlic/stages/script.nix Normal file
View File

@ -0,0 +1,23 @@
{
stdenv
}:
{
script
, shell ? "/bin/sh"
}:
stdenv.mkDerivation {
name = "script";
preferLocalBuild = true;
phases = [ "installPhase" ];
installPhase = ''
cat > $out <<'EOF'
#!${shell}
${script}
EOF
chmod +x $out
'';
}