diff --git a/nixos/modules/services/monitoring/tuptime.nix b/nixos/modules/services/monitoring/tuptime.nix index 334f911a6c71..07ada853760b 100644 --- a/nixos/modules/services/monitoring/tuptime.nix +++ b/nixos/modules/services/monitoring/tuptime.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; - let cfg = config.services.tuptime; @@ -10,17 +7,17 @@ in { options.services.tuptime = { - enable = mkEnableOption "the total uptime service"; + enable = lib.mkEnableOption "the total uptime service"; timer = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = true; description = "Whether to regularly log uptime to detect bad shutdowns."; }; - period = mkOption { - type = types.str; + period = lib.mkOption { + type = lib.types.str; default = "*:0/5"; description = "systemd calendar event"; }; @@ -28,7 +25,7 @@ in { }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.tuptime ]; @@ -59,7 +56,7 @@ in { }; }; - tuptime-sync = mkIf cfg.timer.enable { + tuptime-sync = lib.mkIf cfg.timer.enable { description = "Tuptime scheduled sync service"; serviceConfig = { Type = "oneshot"; @@ -69,7 +66,7 @@ in { }; }; - timers.tuptime-sync = mkIf cfg.timer.enable { + timers.tuptime-sync = lib.mkIf cfg.timer.enable { description = "Tuptime scheduled sync timer"; # this timer should be started if the service is started # even if the timer was previously stopped @@ -85,6 +82,6 @@ in { }; }; - meta.maintainers = [ maintainers.evils ]; + meta.maintainers = [ lib.maintainers.evils ]; }