chore(monitoring): separate external machines

This commit is contained in:
arcnmx 2024-06-01 14:57:57 -07:00
parent d5fb12ad9a
commit bd6f16cd4f
4 changed files with 23 additions and 8 deletions

View file

@ -206,11 +206,20 @@ in {
default = domain;
};
global.enable = mkEnableOption "globally routeable";
online.enable =
mkEnableOption "a deployed machine"
// {
default = true;
};
online = let
proxmoxNodeAccess = systems.${config.proxmox.node.name}.config.access;
in {
enable =
mkEnableOption "a deployed machine"
// {
default = true;
};
available =
mkEnableOption "always on machine"
// {
default = cfg.online.enable && (config.type == "NixOS" || config.proxmox.node.enable || (config.proxmox.vm.enable && proxmoxNodeAccess.online.available));
};
};
hostnameForNetwork = mkOption {
type = attrsOf str;
default = {};

View file

@ -249,7 +249,7 @@ in
enable =
mkEnableOption "health check alerts"
// {
default = config.access.online.enable && config.type == "NixOS";
default = config.access.online.enable && config.access.online.available;
};
};
services = mkOption {

View file

@ -157,12 +157,15 @@
};
groups = {
services = "Services";
servers = "${groups.systems}/Servers";
systems = "Systems";
forSystem = system: let
node = systems.${system.config.proxmox.node.name}.config;
in
if system.config.proxmox.enabled
then "${groups.systems}/${node.name}"
then "${groups.servers}/${node.name}"
else if system.config.access.online.available
then groups.servers
else groups.systems;
};
in {

View file

@ -1,6 +1,9 @@
_: {
type = "Linux";
access.hostName = "u7-pro";
access = {
hostName = "u7-pro";
online.available = true;
};
network.networks = {
local = {
address4 = "10.1.1.3";