forked from DGNum/infrastructure
feat(ups): Use netbirdIp as given in the metadata
This commit is contained in:
parent
4296252fcc
commit
dd10a8e2fe
1 changed files with 15 additions and 8 deletions
|
@ -1,23 +1,29 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
meta,
|
||||||
|
name,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
power.ups = {
|
power.ups = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
ups.eaton = {
|
ups.eaton = {
|
||||||
driver = "usbhid-ups";
|
driver = "usbhid-ups";
|
||||||
port = "auto";
|
port = "auto";
|
||||||
};
|
};
|
||||||
|
|
||||||
users.eatonmon = {
|
users.eatonmon = {
|
||||||
passwordFile = config.age.secrets."eatonmon-password_file".path;
|
passwordFile = config.age.secrets."eatonmon-password_file".path;
|
||||||
upsmon = "primary";
|
upsmon = "primary";
|
||||||
};
|
};
|
||||||
|
|
||||||
upsmon.monitor.eaton = {
|
upsmon.monitor.eaton = {
|
||||||
user = "eatonmon";
|
user = "eatonmon";
|
||||||
};
|
};
|
||||||
|
|
||||||
schedulerRules =
|
schedulerRules =
|
||||||
let
|
let
|
||||||
cmdScript = pkgs.writeShellApplication {
|
cmdScript = pkgs.writeShellApplication {
|
||||||
|
@ -84,8 +90,9 @@
|
||||||
|
|
||||||
services.prometheus.exporters.nut = {
|
services.prometheus.exporters.nut = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "100.80.255.180";
|
listenAddress = meta.network.${name}.netbirdIp;
|
||||||
port = 9199;
|
port = 9199;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.interfaces.wt0.allowedTCPPorts = [ 9199 ];
|
networking.firewall.interfaces.wt0.allowedTCPPorts = [ 9199 ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue