bscpkgs/garlic/stages/srun.nix
Rodrigo Arias Mallo 896ebd4ace WIP nix-isolate
2020-10-09 16:42:06 +02:00

25 lines
380 B
Nix

{
stdenv
, slurm
}:
{
program
, nixPrefix ? ""
, srunOptions ? ""
}:
stdenv.mkDerivation rec {
name = "srun";
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh -ex
exec ${slurm}/bin/srun --mpi=pmi2 ${srunOptions} \
${nixPrefix}${program}
EOF
chmod +x $out
'';
}