diff --git a/cluster/services/irc/default.nix b/cluster/services/irc/default.nix index a27b314..92989cb 100644 --- a/cluster/services/irc/default.nix +++ b/cluster/services/irc/default.nix @@ -1,7 +1,10 @@ -{ config, lib, tools, ... }: +{ config, depot, lib, tools, ... }: let + inherit (depot.config) hours; + inherit (tools.meta) domain; + subDomains = { VEGAS = "eu1"; prophet = "eu2"; @@ -18,11 +21,13 @@ in }; hostLinks = lib.genAttrs config.services.irc.nodes.host (name: { irc = { - ipv4 = "${subDomains.${name}}.irc.${domain}"; + hostname = "${subDomains.${name}}.irc.${domain}"; + ipv4 = hours.${name}.interfaces.primary.addrPublic; inherit (config.links.irc) port; }; ircSecure = { - ipv4 = "${subDomains.${name}}.irc.${domain}"; + hostname = "${subDomains.${name}}.irc.${domain}"; + ipv4 = hours.${name}.interfaces.primary.addrPublic; inherit (config.links.ircSecure) port; }; }); diff --git a/cluster/services/irc/irc-host.nix b/cluster/services/irc/irc-host.nix index 97edd45..afb39c2 100644 --- a/cluster/services/irc/irc-host.nix +++ b/cluster/services/irc/irc-host.nix @@ -15,7 +15,7 @@ let peerLink = cluster.config.hostLinks.${name}.ircSecure; in '' [Server] - Name = ${peerLink.ipv4} + Name = ${peerLink.hostname} Host = ${peerLink.ipv4} Port = ${peerLink.portStr} MyPassword = @PEER_PASSWORD@ @@ -32,7 +32,7 @@ let Mask = *!${name}@* ''; - serverName = linkSecure.ipv4; + serverName = linkSecure.hostname; cert = config.security.acme.certs."${serverName}"; dh = config.security.dhparams.params.ngircd; in { @@ -114,7 +114,7 @@ in { port = linkSecure.port; checks = lib.singleton { interval = "60s"; - tcp = link.tuple; + tcp = "${linkSecure.ipv4}:${linkSecure.portStr}"; }; }; };