depot/cluster/services/irc/default.nix

62 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ config, depot, lib, tools, ... }:
2022-09-18 23:13:06 +03:00
let
inherit (depot.config) hours;
inherit (tools.meta) domain;
subDomains = {
VEGAS = "eu1";
prophet = "eu2";
};
in
2022-09-18 23:13:06 +03:00
{
vars = {
ircPeerKey = {
file = ./irc-peer-key.age;
owner = "ngircd";
group = "ngircd";
};
ircOpers = [ "max" "num" "ark" ];
2022-09-18 23:13:06 +03:00
};
hostLinks = lib.genAttrs config.services.irc.nodes.host (name: {
irc = {
hostname = "${subDomains.${name}}.irc.${domain}";
ipv4 = hours.${name}.interfaces.primary.addrPublic;
inherit (config.links.irc) port;
};
ircSecure = {
hostname = "${subDomains.${name}}.irc.${domain}";
ipv4 = hours.${name}.interfaces.primary.addrPublic;
inherit (config.links.ircSecure) port;
};
});
2022-09-18 23:13:06 +03:00
links = {
irc = {
ipv4 = "irc.${domain}";
2022-09-18 23:13:06 +03:00
port = 6667;
};
ircSecure = {
ipv4 = "irc.${domain}";
2022-09-18 23:13:06 +03:00
port = 6697;
};
};
services.irc = {
nodes = {
host = [ "VEGAS" "prophet" ];
};
nixos = {
host = [
./irc-host.nix
];
};
};
monitoring.blackbox.targets = {
irc = {
address = config.links.ircSecure.tuple;
module = "ircsConnect";
};
};
2022-09-18 23:13:06 +03:00
}