Files
nix-config/hosts/12kingdoms-shushou/ups.nix
T
Ryan Yin 2c7629000f refactor: rename the three VM hosts to 12kingdoms-*
Drop the now-meaningless kubevirt- prefix and move the hosts out of
hosts/k8s/, following the existing 12kingdoms-shoukei layout: the
directory and output carry the theme prefix while the configuration,
hostname and colmena target are the bare name (shoryu, shushou, youko).

- hosts/k8s/kubevirt-* -> hosts/12kingdoms-*; the shared disko config
  becomes host-disko-fs.nix; the now-different relative imports are fixed
- outputs, vars/networking.nix keys, the Justfile recipes/tags, the eval
  tests and the docs follow
- colmena reaches these hosts by IP (a new targetHost override), since
  their DNS name changes with the hostname and is not resolvable until
  the router learns it
2026-09-21 17:10:14 +08:00

52 lines
1.1 KiB
Nix

{ myvars, ... }:
let
hostAddress = myvars.networking.hostsAddr.shushou.ipv4;
in
{
power.ups = {
enable = true;
mode = "standalone";
# Metrics only. Coordinated shutdown of all homelab hosts is a separate feature.
upsmon = {
enable = false;
settings.POWERDOWNFLAG = null;
};
upsd.listen = [
{
address = "127.0.0.1";
port = 3493;
}
];
ups.homelab = {
driver = "nutdrv_qx";
port = "auto";
description = "Homelab UPS";
directives = [
"vendorid = 0665"
"productid = 5161"
];
};
};
services.prometheus.exporters.nut = {
enable = true;
listenAddress = hostAddress;
port = 9199;
nutServer = "127.0.0.1";
# The NixOS module omits --nut.vars_enable when nutVariables is empty, but the exporter needs
# an explicitly empty value to export every numeric NUT variable.
extraFlags = [ "--nut.vars_enable=" ];
};
systemd.services.prometheus-nut-exporter = {
after = [
"upsd.service"
"upsdrv.service"
];
};
}