diff options
author | Janne Heß <janne@hess.ooo> | 2024-01-20 13:14:57 +0100 |
---|---|---|
committer | Janne Heß <janne@hess.ooo> | 2024-01-20 13:14:57 +0100 |
commit | fd8727163d3b0bd77a274e201adf75a3c412d2d6 (patch) | |
tree | 88fd1b65a1d0446ea63383be9e9b2c60878adefa /nixos/modules/services/misc | |
parent | 08183932cef331262e53480b6d670a2b9116c969 (diff) | |
download | nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar.gz nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar.bz2 nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar.lz nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar.xz nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.tar.zst nixlib-fd8727163d3b0bd77a274e201adf75a3c412d2d6.zip |
nixos/nix-gc: Drop with lib;
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r-- | nixos/modules/services/misc/nix-gc.nix | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/nixos/modules/services/misc/nix-gc.nix b/nixos/modules/services/misc/nix-gc.nix index 97596d28cd89..977a0af8bb25 100644 --- a/nixos/modules/services/misc/nix-gc.nix +++ b/nixos/modules/services/misc/nix-gc.nix @@ -1,7 +1,5 @@ { config, lib, ... }: -with lib; - let cfg = config.nix.gc; in @@ -14,14 +12,14 @@ in nix.gc = { - automatic = mkOption { + automatic = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = lib.mdDoc "Automatically run the garbage collector at a specific time."; }; - dates = mkOption { - type = types.str; + dates = lib.mkOption { + type = lib.types.str; default = "03:15"; example = "weekly"; description = lib.mdDoc '' @@ -33,9 +31,9 @@ in ''; }; - randomizedDelaySec = mkOption { + randomizedDelaySec = lib.mkOption { default = "0"; - type = types.str; + type = lib.types.str; example = "45min"; description = lib.mdDoc '' Add a randomized delay before each garbage collection. @@ -45,9 +43,9 @@ in ''; }; - persistent = mkOption { + persistent = lib.mkOption { default = true; - type = types.bool; + type = lib.types.bool; example = false; description = lib.mdDoc '' Takes a boolean argument. If true, the time when the service @@ -61,10 +59,10 @@ in ''; }; - options = mkOption { + options = lib.mkOption { default = ""; example = "--max-freed $((64 * 1024**3))"; - type = types.str; + type = lib.types.str; description = lib.mdDoc '' Options given to {file}`nix-collect-garbage` when the garbage collector is run automatically. @@ -89,7 +87,7 @@ in systemd.services.nix-gc = lib.mkIf config.nix.enable { description = "Nix Garbage Collector"; script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}"; - startAt = optional cfg.automatic cfg.dates; + startAt = lib.optional cfg.automatic cfg.dates; }; systemd.timers.nix-gc = lib.mkIf cfg.automatic { |