bscpkgs/bsc/garlic/srun.nix

23 lines
347 B
Nix
Raw Normal View History

2020-08-17 18:50:18 +02:00
{
stdenv
}:
2020-09-02 10:44:13 +02:00
{
2020-09-02 17:07:09 +02:00
program
2020-09-02 10:44:13 +02:00
, nixPrefix ? ""
, srunOptions ? ""
}:
2020-08-17 18:50:18 +02:00
stdenv.mkDerivation rec {
2020-09-02 17:07:09 +02:00
name = "srun";
2020-08-17 18:50:18 +02:00
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
2020-09-02 17:07:09 +02:00
cat > $out <<EOF
2020-08-17 18:50:18 +02:00
#!/bin/sh
2020-09-02 17:07:09 +02:00
exec srun --mpi=pmi2 ${srunOptions} ${nixPrefix}${program}
2020-08-17 18:50:18 +02:00
EOF
2020-09-02 17:07:09 +02:00
chmod +x $out
2020-08-17 18:50:18 +02:00
'';
}