aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-05-16 21:17:57 +1000
committerJustin Bedo <cu@cua0.org>2019-05-16 21:32:21 +1000
commitfa35a2634108bd179de0c7dd21ca5355f6918a9b (patch)
treee1981644ba1d8597c660c7a6e13051a270842b91 /lib
parentfaa64f72447c26706e2c15c02f70443c7b325091 (diff)
sbatch: allow path specification for salloc
Diffstat (limited to 'lib')
-rw-r--r--lib/sbatch.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbatch.nix b/lib/sbatch.nix
index efb7654..d52c23e 100644
--- a/lib/sbatch.nix
+++ b/lib/sbatch.nix
@@ -2,7 +2,7 @@
with lib;
-{ ppn, mem, walltime, partition ? null, slurmFlags ? null}:
+{ ppn, mem, walltime, partition ? null, slurmFlags ? null, salloc ? "/usr/bin/salloc" }:
drv:
let ppnReified = if drv.multicore then ppn else 1;
in lib.overrideDerivation drv ({ args, builder, name, ... }: {
@@ -17,7 +17,7 @@ drv:
#!${stdenv.shell}
NIX_BUILD_CORES=${toString ppnReified}
- salloc -c $NIX_BUILD_CORES --mem=${toString mem}G -t ${walltime} \
+ ${salloc} -c $NIX_BUILD_CORES --mem=${toString mem}G -t ${walltime} \
-J "${name}" \
${optionalString (partition != null) "-p ${partition}"} \
${optionalString (slurmFlags != null) slurmFlags} \