bscpkgs/bsc/garlic/srun.nix

25 lines
422 B
Nix
Raw Normal View History

2020-08-18 00:50:18 +08:00
{
stdenv
}:
2020-09-02 16:44:13 +08:00
{
app
, nixPrefix ? ""
, srunOptions ? ""
}:
2020-08-18 00:50:18 +08: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 16:44:13 +08:00
exec srun --mpi=pmi2 ${srunOptions} ${nixPrefix}${app}/bin/run
2020-08-18 00:50:18 +08:00
EOF
chmod +x $out/bin/run
'';
}