bscpkgs/bsc/garlic/srun.nix
2020-08-17 18:50:18 +02:00

21 lines
386 B
Nix

{
stdenv
}:
{ app , nixPrefix ? "" }:
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
exec srun --mpi=pmi2 ${nixPrefix}${app}/bin/run
EOF
chmod +x $out/bin/run
'';
}