bscpkgs/bsc/garlic/srun.nix

21 lines
386 B
Nix
Raw Normal View History

2020-08-17 18:50:18 +02:00
{
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
'';
}