mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore(monitoring): separate external machines
This commit is contained in:
parent
d5fb12ad9a
commit
bd6f16cd4f
4 changed files with 23 additions and 8 deletions
|
|
@ -206,11 +206,20 @@ in {
|
||||||
default = domain;
|
default = domain;
|
||||||
};
|
};
|
||||||
global.enable = mkEnableOption "globally routeable";
|
global.enable = mkEnableOption "globally routeable";
|
||||||
online.enable =
|
online = let
|
||||||
mkEnableOption "a deployed machine"
|
proxmoxNodeAccess = systems.${config.proxmox.node.name}.config.access;
|
||||||
// {
|
in {
|
||||||
default = true;
|
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 {
|
hostnameForNetwork = mkOption {
|
||||||
type = attrsOf str;
|
type = attrsOf str;
|
||||||
default = {};
|
default = {};
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ in
|
||||||
enable =
|
enable =
|
||||||
mkEnableOption "health check alerts"
|
mkEnableOption "health check alerts"
|
||||||
// {
|
// {
|
||||||
default = config.access.online.enable && config.type == "NixOS";
|
default = config.access.online.enable && config.access.online.available;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services = mkOption {
|
services = mkOption {
|
||||||
|
|
|
||||||
|
|
@ -157,12 +157,15 @@
|
||||||
};
|
};
|
||||||
groups = {
|
groups = {
|
||||||
services = "Services";
|
services = "Services";
|
||||||
|
servers = "${groups.systems}/Servers";
|
||||||
systems = "Systems";
|
systems = "Systems";
|
||||||
forSystem = system: let
|
forSystem = system: let
|
||||||
node = systems.${system.config.proxmox.node.name}.config;
|
node = systems.${system.config.proxmox.node.name}.config;
|
||||||
in
|
in
|
||||||
if system.config.proxmox.enabled
|
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;
|
else groups.systems;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
_: {
|
_: {
|
||||||
type = "Linux";
|
type = "Linux";
|
||||||
access.hostName = "u7-pro";
|
access = {
|
||||||
|
hostName = "u7-pro";
|
||||||
|
online.available = true;
|
||||||
|
};
|
||||||
network.networks = {
|
network.networks = {
|
||||||
local = {
|
local = {
|
||||||
address4 = "10.1.1.3";
|
address4 = "10.1.1.3";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue