mob next [ci-skip] [ci skip] [skip ci]
lastFile:machines/vega/services/ups.nix
This commit is contained in:
33
machines/vega/services/ups.nix
Normal file
33
machines/vega/services/ups.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user