aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2021-02-08 17:40:52 +1100
committerJustin Bedo <cu@cua0.org>2021-02-08 17:40:52 +1100
commit4f7f2770baecc5f72ca9e90d7996c0a1554bda1b (patch)
tree4b0136a472ded1ce436df32347433a459344e3cb /default.nix
parent7de4d55d39fd39e1abb2b4bc8e0ba0d026bca54a (diff)
refactor slurm implementation to allow for overlays
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix33
1 files changed, 14 insertions, 19 deletions
diff --git a/default.nix b/default.nix
index 0859085..2e98d6d 100644
--- a/default.nix
+++ b/default.nix
@@ -50,24 +50,18 @@ let
whisper = callBionix ./tools/whisper.nix { };
star = callBionix ./tools/star.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";
- 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);
- });
+ slurm-run = callPackage ./lib/slurm.nix { };
+ slurm-exec = f: x: y:
+ slurm-run x (f (builtins.removeAttrs x [
+ "ppn"
+ "mem"
+ "walltime"
+ "partition"
+ "slurmFlags"
+ "salloc"
+ "srun"
+ ]) y);
+ slurm = bionix.extend (self: super: { exec = super.slurm-run; });
qsub = attrs:
bionix.extend (self: super:
with self; rec {
@@ -190,7 +184,8 @@ let
overlayByType = {
lambda = bionix: overlay:
- bionix.extend overlay;
+ bionix.extend
+ (self: super: nixpkgs.lib.recursiveUpdate super (overlay self super));
path = bionix: path: overlay bionix (import path);
};
overlay = bionix: overlay: