diff options
-rw-r--r-- | default.nix | 2 | ||||
-rw-r--r-- | lib/slurm.nix | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/default.nix b/default.nix index a0ecce0..9bc7b6c 100644 --- a/default.nix +++ b/default.nix @@ -38,7 +38,7 @@ let fastp = callBionix ./tools/fastp.nix {}; slurm = attrs: bionix.extend (self: super: with self; rec { - slurmDefs = { ppn = 1; mem = 1; walltime = "24:00:00"; partition = null; slurmFlags = null; salloc = "/usr/bin/salloc"; } // attrs; + slurmDefs = { ppn = 1; mem = 1; walltime = "24:00:00"; partition = null; slurmFlags = null; salloc = "/usr/bin/salloc"; srun = "/usr/bin/srun"; } // attrs; slurm = attrs: (callPackage ./lib/slurm.nix {}) (slurmDefs // attrs); exec = f: x: y: slurm (builtins.intersectAttrs slurmDefs x) (super.exec f (builtins.removeAttrs x (builtins.attrNames slurmDefs)) y); }); diff --git a/lib/slurm.nix b/lib/slurm.nix index daca4af..30a5f5e 100644 --- a/lib/slurm.nix +++ b/lib/slurm.nix @@ -2,7 +2,7 @@ with lib; -{ ppn, mem, walltime, partition ? null, slurmFlags ? null, salloc ? "/usr/bin/salloc" }: +{ ppn, mem, walltime, partition ? null, slurmFlags ? null, salloc ? "/usr/bin/salloc", srun ? "/usr/bin/srun" }: drv: let ppnReified = if drv.multicore then ppn else 1; in lib.overrideDerivation drv ({ args, builder, name, ... }: { @@ -21,7 +21,7 @@ drv: -J "${name}" \ ${optionalString (partition != null) "-p ${partition}"} \ ${optionalString (slurmFlags != null) slurmFlags} \ - ${script} + ${srun} ${script} ''; in [ "-c" slurm ]; |