summaryrefslogtreecommitdiff
path: root/modules/services/nix-gc
diff options
context:
space:
mode:
authorMike Vink <59492084+ivi-vink@users.noreply.github.com>2025-01-16 22:22:34 +0100
committerGitHub <noreply@github.com>2025-01-16 22:22:34 +0100
commit8e7bd91f353caacc0bc4105f573eb3e17f09e03a (patch)
treec5059edcbebd9644290cad7c653c49a36d593021 /modules/services/nix-gc
parent6bd39d420578aacf7c0bab7de3e7027b952115ae (diff)
parentbd921223ba7cdac346477d7ea5204d6f4736fcc6 (diff)
Merge branch 'LnL7:master' into masterHEADmaster
Diffstat (limited to 'modules/services/nix-gc')
-rw-r--r--modules/services/nix-gc/default.nix19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/services/nix-gc/default.nix b/modules/services/nix-gc/default.nix
index f13e250..9fe8e86 100644
--- a/modules/services/nix-gc/default.nix
+++ b/modules/services/nix-gc/default.nix
@@ -6,6 +6,7 @@ with lib;
let
cfg = config.nix.gc;
+ launchdTypes = import ../../launchd/types.nix { inherit config lib; };
in
{
@@ -24,27 +25,31 @@ in
automatic = mkOption {
default = false;
type = types.bool;
- description = lib.mdDoc "Automatically run the garbage collector at a specific time.";
+ description = "Automatically run the garbage collector at a specific time.";
};
# Not in NixOS module
user = mkOption {
type = types.nullOr types.str;
default = null;
- description = lib.mdDoc "User that runs the garbage collector.";
+ description = "User that runs the garbage collector.";
};
interval = mkOption {
- type = types.attrs;
- default = { Hour = 3; Minute = 15; };
- description = lib.mdDoc "The time interval at which the garbage collector will run.";
+ type = launchdTypes.StartCalendarInterval;
+ default = [{ Weekday = 7; Hour = 3; Minute = 15; }];
+ description = ''
+ The calendar interval at which the garbage collector will run.
+ See the {option}`serviceConfig.StartCalendarInterval` option of
+ the {option}`launchd` module for more info.
+ '';
};
options = mkOption {
default = "";
example = "--max-freed $((64 * 1024**3))";
type = types.str;
- description = lib.mdDoc ''
+ description = ''
Options given to {file}`nix-collect-garbage` when the
garbage collector is run automatically.
'';
@@ -63,7 +68,7 @@ in
command = "${config.nix.package}/bin/nix-collect-garbage ${cfg.options}";
environment.NIX_REMOTE = optionalString config.nix.useDaemon "daemon";
serviceConfig.RunAtLoad = false;
- serviceConfig.StartCalendarInterval = [ cfg.interval ];
+ serviceConfig.StartCalendarInterval = cfg.interval;
serviceConfig.UserName = cfg.user;
};