nixos/services.tuptime: remove with lib;
This commit is contained in:
parent
307f280e81
commit
6974870a0a
@ -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 ];
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user