irisd carried 3 pieces of config that were confusingly spread around ogygia/defualt.nix. These are the irisd config itself with a host list, the Nebula firewall group & rules, and the impermanence settings. Extract it into ogygia/irisd.nix so these are all more clearly related. Test plan: - eyes (no-op refactor)
31 lines
764 B
Nix
31 lines
764 B
Nix
{ 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" ];
|
|
};
|
|
}
|