move stuff
This commit is contained in:
52
systems/x86_64-linux/jallen-nas/ups.nix
Executable file
52
systems/x86_64-linux/jallen-nas/ups.nix
Executable file
@@ -0,0 +1,52 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
enableUps = true;
|
||||
upsName = "nas-ups";
|
||||
upsUser = "nas-admin";
|
||||
in
|
||||
{
|
||||
power.ups = {
|
||||
enable = enableUps;
|
||||
openFirewall = enableUps;
|
||||
mode = "netserver";
|
||||
|
||||
ups = {
|
||||
"${upsName}" = {
|
||||
description = "NAS UPS";
|
||||
driver = "usbhid-ups";
|
||||
port = "auto";
|
||||
};
|
||||
};
|
||||
|
||||
users."${upsUser}" = {
|
||||
passwordFile = config.sops.secrets."jallen-nas/ups_password".path;
|
||||
actions = [ "ALL" ];
|
||||
instcmds = [ "ALL" ];
|
||||
upsmon = "primary";
|
||||
};
|
||||
|
||||
upsmon = {
|
||||
enable = enableUps;
|
||||
monitor."${upsName}" = {
|
||||
passwordFile = config.sops.secrets."jallen-nas/ups_password".path;
|
||||
user = upsUser;
|
||||
};
|
||||
};
|
||||
|
||||
upsd = {
|
||||
enable = enableUps;
|
||||
listen = [
|
||||
{
|
||||
address = "0.0.0.0";
|
||||
port = 3493;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
apcupsd = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user