File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
nixos/modules/services/monitoring Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 509509 else lib . unique ( lib . forEach cfg . upsd . listen ( listen : listen . port ) ) ;
510510 } ;
511511
512+ systemd . slices . system-ups = {
513+ description = "Network UPS Tools (NUT) Slice" ;
514+ documentation = [ "https://networkupstools.org/" ] ;
515+ } ;
516+
512517 systemd . services . upsmon = let
513518 secrets = lib . mapAttrsToList ( name : monitor : "upsmon_password_${ name } " ) cfg . upsmon . monitor ;
514519 createUpsmonConf = installSecrets upsmonConf "/run/nut/upsmon.conf" secrets ;
523528 ExecStart = "${ pkgs . nut } /sbin/upsmon" ;
524529 ExecReload = "${ pkgs . nut } /sbin/upsmon -c reload" ;
525530 LoadCredential = lib . mapAttrsToList ( name : monitor : "upsmon_password_${ name } :${ monitor . passwordFile } " ) cfg . upsmon . monitor ;
531+ Slice = "system-ups.slice" ;
526532 } ;
527533 environment = envVars ;
528534 } ;
542548 ExecStart = "${ pkgs . nut } /sbin/upsd -u root" ;
543549 ExecReload = "${ pkgs . nut } /sbin/upsd -c reload" ;
544550 LoadCredential = lib . mapAttrsToList ( name : user : "upsdusers_password_${ name } :${ user . passwordFile } " ) cfg . users ;
551+ Slice = "system-ups.slice" ;
545552 } ;
546553 environment = envVars ;
547554 restartTriggers = [
559566 RemainAfterExit = true ;
560567 # TODO: replace 'root' by another username.
561568 ExecStart = "${ pkgs . nut } /bin/upsdrvctl -u root start" ;
569+ Slice = "system-ups.slice" ;
562570 } ;
563571 environment = envVars ;
564572 restartTriggers = [
You can’t perform that action at this time.
0 commit comments