From 2b90f4cdb3a17a95ecf59b43fd01b0b577109709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 27 Sep 2024 19:36:34 +0200 Subject: [PATCH] nixos/ups: sort settings attributes They're listed twice (documentation and implementation) and this change makes it easier to compare the attrsets. --- nixos/modules/services/monitoring/ups.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/monitoring/ups.nix b/nixos/modules/services/monitoring/ups.nix index 9361393d91af..ca11cb0e3f9b 100644 --- a/nixos/modules/services/monitoring/ups.nix +++ b/nixos/modules/services/monitoring/ups.nix @@ -309,8 +309,8 @@ let defaultText = lib.literalMD '' { MINSUPPLIES = 1; - RUN_AS_USER = "root"; NOTIFYCMD = "''${pkgs.nut}/bin/upssched"; + RUN_AS_USER = "root"; SHUTDOWNCMD = "''${pkgs.systemd}/bin/shutdown now"; } ''; @@ -330,11 +330,11 @@ let config = { enable = lib.mkDefault (lib.elem cfg.mode [ "standalone" "netserver" "netclient" ]); settings = { - RUN_AS_USER = "root"; # TODO: replace 'root' by another username. MINSUPPLIES = lib.mkDefault 1; - NOTIFYCMD = lib.mkDefault "${pkgs.nut}/bin/upssched"; - SHUTDOWNCMD = lib.mkDefault "${pkgs.systemd}/bin/shutdown now"; MONITOR = lib.flip lib.mapAttrsToList cfg.upsmon.monitor (name: monitor: with monitor; [ system powerValue user "\"@upsmon_password_${name}@\"" type ]); + NOTIFYCMD = lib.mkDefault "${pkgs.nut}/bin/upssched"; + RUN_AS_USER = "root"; # TODO: replace 'root' by another username. + SHUTDOWNCMD = lib.mkDefault "${pkgs.systemd}/bin/shutdown now"; }; }; };