ogygia: extract irisd #1255

Merged
JakeHillion merged 1 commits from jj/xsxtumywruwp into main 2026-07-30 10:48:52 +01:00
2 changed files with 35 additions and 19 deletions

No files matched your search

+5 -19
View File
@@ -3,9 +3,6 @@
let
cfg = config.custom.ogygia;
allHosts = builtins.attrNames (builtins.readDir ../../hosts);
hosts = builtins.filter (h: h != "fanboy.cx.neb.jakehillion.me" && h != config.networking.fqdn) allHosts;
domain = config.ogygia.domain;
user = config.custom.user;
@@ -34,6 +31,10 @@ let
caKeyTarget = "${config.users.users.${user}.home}/local/sync/sync/keys/nebula-ca-2527.key";
in
{
imports = [
./irisd.nix
];
options.custom.ogygia = {
enable = lib.mkEnableOption "ogygia";
};
@@ -45,13 +46,6 @@ in
gitRemoteUrl = "https://gitea.hillion.co.uk/JakeHillion/nixos.git";
irisd = {
enable = true;
configureNixDaemon = true;
settings.peers.urls = builtins.map (fqdn: "http://${fqdn}:35742") hosts;
};
etcd = {
endpoints = config.custom.services.etcd.endpoints;
};
@@ -67,11 +61,9 @@ in
# `ogygia nebula` CLI reads and writes them.
certDir = ../../nebula;
# irisd-client is fleet-wide (every host pulls from the peer cache).
# etcd-client follows hostinfod, the etcd publisher, so a host that
# disables it (fanboy) gets no etcd access.
groups = [ "irisd-client" ]
++ lib.optional config.ogygia.hostinfod.enable "etcd-client";
groups = lib.optional config.ogygia.hostinfod.enable "etcd-client";
firewall.inbound = [
# SSH is allowed from every mesh peer, no group required. This keeps
@@ -80,10 +72,6 @@ in
# fanboy reach the rest of the fleet over Nebula.
{ host = "any"; port = 22; proto = "tcp"; }
# Reproduce the legacy allow-all inbound posture. Per-host cert groups
# live in each host's own config (see ogygia.nebula.groups there).
{ groups = [ "irisd-client" ]; port = 35742; proto = "tcp"; }
# Reproduce the legacy allow-all inbound posture. Per-host cert groups
# live in each host's own config (see ogygia.nebula.groups there).
{ groups = [ "legacy-full-access" ]; port = "any"; proto = "any"; }
@@ -143,8 +131,6 @@ in
systemd.tmpfiles.rules = lib.mkIf (config.ogygia.updated.enable && config.custom.impermanence.enable)
[ "d ${config.custom.impermanence.base}/system/var/lib/ogygia-updated 0700 root root - -" ];
custom.impermanence.extraDirs = lib.mkIf config.custom.impermanence.enable [ "/var/cache/private/ogygia-irisd" ];
# Reuse the legacy Nebula keypair. The private key stays at its existing
# /data/nebula/host.key (persistent, already owned by the nebula service
# uid) — point the network straight at it rather than via /etc/nebula,
+30
View File
@@ -0,0 +1,30 @@
{ pkgs, lib, config, ... }:
let
cfg = config.custom.ogygia;
allHosts = builtins.attrNames (builtins.readDir ../../hosts);
hosts = builtins.filter (h: h != "fanboy.cx.neb.jakehillion.me" && h != config.networking.fqdn) allHosts;
in
{
config = lib.mkIf cfg.enable {
ogygia = {
irisd = {
enable = true;
configureNixDaemon = true;
settings.peers.urls = builtins.map (fqdn: "http://${fqdn}:35742") hosts;
};
nebula = {
groups = [ "irisd-client" ];
firewall.inbound = [
{ groups = [ "irisd-client" ]; port = 35742; proto = "tcp"; }
];
};
};
custom.impermanence.extraDirs = lib.mkIf config.custom.impermanence.enable [ "/var/cache/private/ogygia-irisd" ];
};
}