ogygia: extract irisd #1255
No files matched your search
@@ -3,9 +3,6 @@
|
|||||||
let
|
let
|
||||||
cfg = config.custom.ogygia;
|
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;
|
domain = config.ogygia.domain;
|
||||||
user = config.custom.user;
|
user = config.custom.user;
|
||||||
|
|
||||||
@@ -34,6 +31,10 @@ let
|
|||||||
caKeyTarget = "${config.users.users.${user}.home}/local/sync/sync/keys/nebula-ca-2527.key";
|
caKeyTarget = "${config.users.users.${user}.home}/local/sync/sync/keys/nebula-ca-2527.key";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./irisd.nix
|
||||||
|
];
|
||||||
|
|
||||||
options.custom.ogygia = {
|
options.custom.ogygia = {
|
||||||
enable = lib.mkEnableOption "ogygia";
|
enable = lib.mkEnableOption "ogygia";
|
||||||
};
|
};
|
||||||
@@ -45,13 +46,6 @@ in
|
|||||||
|
|
||||||
gitRemoteUrl = "https://gitea.hillion.co.uk/JakeHillion/nixos.git";
|
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 = {
|
etcd = {
|
||||||
endpoints = config.custom.services.etcd.endpoints;
|
endpoints = config.custom.services.etcd.endpoints;
|
||||||
};
|
};
|
||||||
@@ -67,11 +61,9 @@ in
|
|||||||
# `ogygia nebula` CLI reads and writes them.
|
# `ogygia nebula` CLI reads and writes them.
|
||||||
certDir = ../../nebula;
|
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
|
# etcd-client follows hostinfod, the etcd publisher, so a host that
|
||||||
# disables it (fanboy) gets no etcd access.
|
# disables it (fanboy) gets no etcd access.
|
||||||
groups = [ "irisd-client" ]
|
groups = lib.optional config.ogygia.hostinfod.enable "etcd-client";
|
||||||
++ lib.optional config.ogygia.hostinfod.enable "etcd-client";
|
|
||||||
|
|
||||||
firewall.inbound = [
|
firewall.inbound = [
|
||||||
# SSH is allowed from every mesh peer, no group required. This keeps
|
# 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.
|
# fanboy reach the rest of the fleet over Nebula.
|
||||||
{ host = "any"; port = 22; proto = "tcp"; }
|
{ 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
|
# Reproduce the legacy allow-all inbound posture. Per-host cert groups
|
||||||
# live in each host's own config (see ogygia.nebula.groups there).
|
# live in each host's own config (see ogygia.nebula.groups there).
|
||||||
{ groups = [ "legacy-full-access" ]; port = "any"; proto = "any"; }
|
{ 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)
|
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 - -" ];
|
[ "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
|
# Reuse the legacy Nebula keypair. The private key stays at its existing
|
||||||
# /data/nebula/host.key (persistent, already owned by the nebula service
|
# /data/nebula/host.key (persistent, already owned by the nebula service
|
||||||
# uid) — point the network straight at it rather than via /etc/nebula,
|
# uid) — point the network straight at it rather than via /etc/nebula,
|
||||||
|
|||||||
@@ -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" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user