bscpkgs/bsc/garlic/srun.nix

25 lines
422 B
Nix
Raw Normal View History

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