depot/cluster/services/irc/default.nix

62 lines
1.2 KiB
Nix
Raw Normal View History

2023-08-31 01:55:45 +03:00
{ config, depot, lib, ... }:
2022-09-18 23:13:06 +03:00
let
2023-08-31 01:55:45 +03:00
inherit (depot) hours;
2023-08-31 01:55:45 +03:00
inherit (depot.lib.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
}