From 70f67f6e716737eef050eceacf052744dc68eda5 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 Jun 2023 21:13:20 +0200 Subject: [PATCH] cluster/services/irc: no DNS indirection --- cluster/services/irc/default.nix | 11 ++++++++--- cluster/services/irc/irc-host.nix | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) 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}"; }; }; };