modules.services.slurm: set timeLimit as optional

This commit is contained in:
2025-10-31 11:45:52 +08:00
parent 08e28bf7c8
commit 02b36bdf84
2 changed files with 3 additions and 1 deletions

View File

@@ -82,6 +82,7 @@ inputs:
{ name = "n2"; gpuIds = [ "a30" ]; }
];
};
timeLimit = "48:00:00";
};
};
packages = { vasp = {}; desktop = {}; lumerical = {}; };

View File

@@ -44,6 +44,7 @@ inputs:
default = null;
};
};
timeLimit = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};
config = let inherit (inputs.config.nixos.services) slurm; in inputs.lib.mkIf slurm.enable (inputs.lib.mkMerge
[
@@ -103,7 +104,7 @@ inputs:
n
"Nodes=${builtins.concatStringsSep "," (builtins.map (n: slurm.node.${n}.name) v)}"
"Default=${if n == slurm.defaultPartition then "YES" else "NO"}"
"MaxTime=48:00:00"
"MaxTime=${if slurm.timeLimit != null then slurm.timeLimit else "INFINITE"}"
"State=UP"
])
slurm.partitions;