From d2f32c75af937e36dd2e3db1921ef7a6ec282837 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Fri, 6 Sep 2024 10:54:21 +0200 Subject: [PATCH] ups: init on argon --- agenix/hosts/argon/config.nix | 4 ++++ agenix/hosts/argon/ups/primaryPassword.age | 7 +++++++ secrets.nix | 2 ++ system/hosts/argon.nix | 24 ++++++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 agenix/hosts/argon/ups/primaryPassword.age diff --git a/agenix/hosts/argon/config.nix b/agenix/hosts/argon/config.nix index 2766024..82ef5a0 100644 --- a/agenix/hosts/argon/config.nix +++ b/agenix/hosts/argon/config.nix @@ -39,6 +39,10 @@ group = "mosquitto"; }; + ups-primary-password = { + file = ./ups/primaryPassword.age; + }; + weewx-proxy-environment = { file = ./weewx-proxy/environment.age; }; diff --git a/agenix/hosts/argon/ups/primaryPassword.age b/agenix/hosts/argon/ups/primaryPassword.age new file mode 100644 index 0000000..d320dac --- /dev/null +++ b/agenix/hosts/argon/ups/primaryPassword.age @@ -0,0 +1,7 @@ +age-encryption.org/v1 +-> ssh-ed25519 MtGp6g ZX57M5ki05gFAm/cIZIiqlX1by+eosXddvWln3y4nEM +E/Ew7nB38f6RnMZMjg4J5/qFUmz2jJl11RiqEsi6Cd0 +-> ssh-ed25519 1fcLUQ 26z8R+YdIcdALuBorv2rboW25fDC7Xern/r8PCX8E00 +lr+KVKkgrU/zHg/nZAbZyzYIhe0euYeZy1kWzPK1MD4 +--- rA/LWzan74b4214noRwwzrtpR1sx4NK844K8pGFbEDk +̭]5y%:)62{KyNG.x\Y "*| \ No newline at end of file diff --git a/secrets.nix b/secrets.nix index d0bf45d..6d5d18d 100644 --- a/secrets.nix +++ b/secrets.nix @@ -108,6 +108,8 @@ in "agenix/hosts/argon/adguardhome-sync/environment.age".publicKeys = argon; + "agenix/hosts/argon/ups/primaryPassword.age".publicKeys = argon; + "agenix/hosts/argon/weewx-proxy/environment.age".publicKeys = argon; # neon diff --git a/system/hosts/argon.nix b/system/hosts/argon.nix index 0b984fc..7dc6a63 100644 --- a/system/hosts/argon.nix +++ b/system/hosts/argon.nix @@ -189,6 +189,30 @@ in services.hardware.argonone.enable = true; + power.ups = { + enable = true; + mode = "standalone"; + openFirewall = true; + + ups.primary = { + description = "APC Back-UPS BX - BX950U-GR"; + driver = "usbhid-ups"; + port = "auto"; + }; + + users.upsmon = { + passwordFile = config.age.secrets.ups-primary-password.path; + upsmon = "primary"; + }; + + upsd.listen = [ + { address = "127.0.0.1"; } + { address = "10.0.0.5"; } + ]; + + upsmon.monitor.primary.user = "upsmon"; + }; + programs = { fish.enable = true; zsh.enable = true;