mob next [ci-skip] [ci skip] [skip ci]

lastFile:machines/vega/services/ups.nix
This commit is contained in:
2025-09-25 17:28:59 +07:00
parent c102be10c6
commit 9ddef2b268

View File

@@ -0,0 +1,33 @@
{ config, ... }:
{
clan.core.vars.generators.ups = {
dependencies = [ "root-password" ];
files.password = {
secret = true;
owner = "nutmon";
group = "nutmon";
};
script = ''
cat $in/root-password/password > $out/password
'';
};
power.ups = {
enable = true;
mode = "standalone";
ups."apc" = {
driver = "usbhid-ups";
port = "auto";
};
upsmon.monitor."test-monitor" = {
powerValue = 1;
user = "root";
type = "primary";
passwordFile = config.clan.core.vars.generators.ups.files.password.path;
};
upsmon.settings = {
RUN_AS_USER = "root";
};
};
}