]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - systems/eldiron/irc.nix
Migrate to borg backup
[perso/Immae/Config/Nix.git] / systems / eldiron / irc.nix
1 { lib, pkgs, config, ... }:
2 let
3 cfg = config.myServices.irc;
4 in
5 {
6 options.myServices = {
7 irc.enable = lib.mkOption {
8 type = lib.types.bool;
9 default = false;
10 description = ''
11 Whether to enable irc stuff.
12 '';
13 };
14 };
15
16 config = lib.mkIf cfg.enable {
17 myServices.dns.zones."immae.eu".subdomains.irc =
18 with config.myServices.dns.helpers; ips servers.eldiron.ips.main;
19
20 myServices.chatonsProperties.services.bitlbee = {
21 file.datetime = "2022-08-27T19:00:00";
22 service = {
23 name = "Bitlbee";
24 description = "An IRC to other chat networks gateway";
25 logo = "https://www.bitlbee.org/style/logo.png";
26 website = "irc.immae.eu";
27 status.level = "OK";
28 status.description = "OK";
29 registration."" = ["MEMBER" "CLIENT"];
30 registration.load = "FULL";
31 install.type = "PACKAGE";
32 };
33 software = {
34 name = "BitlBee";
35 website = "https://www.bitlbee.org/";
36 license.url = "https://github.com/bitlbee/bitlbee/blob/master/COPYING";
37 license.name = "GNU General Public License v2.0";
38 version = pkgs.bitlbee.version;
39 source.url = "https://github.com/bitlbee/bitlbee";
40 modules = map (a: a.pname) config.services.bitlbee.plugins
41 ++ map (a: a.pname) config.services.bitlbee.libpurple_plugins;
42 };
43 };
44 security.acme.certs."irc" = {
45 domain = "irc.immae.eu";
46 postRun = ''
47 systemctl restart stunnel.service
48 '';
49 };
50
51 networking.firewall.allowedTCPPorts = [ 6697 ];
52 services.bitlbee = with pkgs; {
53 enable = true;
54 authMode = "Registered";
55 libpurple_plugins = [
56 purple-hangouts
57 purple-matrix
58 purple-facebook
59 purple-googlechat
60 ];
61 plugins = [
62 bitlbee-mastodon
63 bitlbee-facebook
64 bitlbee-discord
65 bitlbee-steam
66 ];
67 };
68
69 services.stunnel = {
70 enable = true;
71 servers = {
72 bitlbee = {
73 accept = 6697;
74 connect = 6667;
75 cert = "${config.security.acme.certs.irc.directory}/full.pem";
76 };
77 };
78 };
79 };
80 }