From 007f448fe89a95c132c96b1d5b4fb1958df1e445 Mon Sep 17 00:00:00 2001 From: Weckyy702 Date: Wed, 13 May 2026 17:41:03 +0200 Subject: [PATCH] Add nut and upsmon --- modules/hosts/keith/ups.nix | 19 +++++++++++++++++++ modules/services/nut.nix | 12 ++++++++++++ secrets/secrets.nix | 5 +++++ secrets/upsmon.age | 12 ++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 modules/hosts/keith/ups.nix create mode 100644 modules/services/nut.nix create mode 100644 secrets/upsmon.age diff --git a/modules/hosts/keith/ups.nix b/modules/hosts/keith/ups.nix new file mode 100644 index 0000000..05a5c04 --- /dev/null +++ b/modules/hosts/keith/ups.nix @@ -0,0 +1,19 @@ +{ self +, inputs +, ... +}: { + flake.modules.nixos.keith = { config, ... }: { + age.secrets.upsmon.file = "${inputs.secrets}/upsmon.age"; + + imports = with self.factory; [ + (nut-client { + buggie = { + type = "slave"; + passwordFile = config.age.secrets.upsmon.path; + system = "main-ups@buggie.veltnet"; + user = "observer"; + }; + }) + ]; + }; +} diff --git a/modules/services/nut.nix b/modules/services/nut.nix new file mode 100644 index 0000000..ed05317 --- /dev/null +++ b/modules/services/nut.nix @@ -0,0 +1,12 @@ +{ + config.flake.factory.nut-client = config: { + power.ups = { + enable = true; + mode = "netclient"; + upsmon = { + enable = true; + monitor = config; + }; + }; + }; +} diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 4a2fdf4..94bffb3 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -11,4 +11,9 @@ in publicKeys = systems ++ users; armor = true; }; + + "upsmon.age" = { + publicKeys = systems ++ users; + armor = true; + }; } diff --git a/secrets/upsmon.age b/secrets/upsmon.age new file mode 100644 index 0000000..313d81a --- /dev/null +++ b/secrets/upsmon.age @@ -0,0 +1,12 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IFNjTWNPZyBUZWty +ZGZiS2V4b1l4d3RIck9OZUlkZnpYelUyc2Y0L3FOMzNBZ0thU1VBCjFWdC9JV0M2 +YnJ6UTNRUTdPV3pYMkdJa2pRdHVYZDlJRmVmb0liTGpFSlkKLT4gc3NoLWVkMjU1 +MTkgZkJwNFR3IFFvMEhYTGlLVlg5eU5jZEh4TC93ZU9NeFJ2WXlaVVIwL096cktR +V3hIeVEKK0RMczZFeFJRS0g0TWFGcG1Ic21oMzgvc0Z2NjZOSVgxc3RtVVhNcXdr +OAotPiBzc2gtZWQyNTUxOSBZazBxSWcgMXJUdGFFT2hWcWpIR1BMbkw4ZEpRcGJN +M1hETXlCVnhXeGhzR2UzdEVtdwpWdzc1aG9ZN0x5MEx6TEVLckwrakYyci9lVHJZ +V2IzQUtGcjRqUVBiRG9BCi0tLSB0dHJHRGE0b0IvQXk5ci83Sm5HQzRiY2hJV25N +MG9QazU1M0JBeUo2eWdZCvvJHo4I0ry33lbaUTowOjS3gZHoBw9v3OWNrA4QHG9M +/TRPcPZ1pjX9m9+seg== +-----END AGE ENCRYPTED FILE-----