34 lines
670 B
Nix
34 lines
670 B
Nix
{ 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";
|
|
};
|
|
};
|
|
}
|