]>
Commit | Line | Data |
---|---|---|
ffb14c1c IB |
1 | { lib, pkgs, config, ... }: |
2 | let | |
3 | cfg = config.myServices.irc; | |
4 | in | |
31a38b9f | 5 | { |
ffb14c1c IB |
6 | options.myServices = { |
7 | ircCerts = lib.mkOption { | |
8 | description = "Default ircconfigurations for certificates as accepted by acme"; | |
9 | }; | |
10 | irc.enable = lib.mkOption { | |
31a38b9f IB |
11 | type = lib.types.bool; |
12 | default = false; | |
13 | description = '' | |
14 | Whether to enable irc stuff. | |
15 | ''; | |
16 | }; | |
17 | }; | |
18 | ||
ffb14c1c | 19 | config = lib.mkIf cfg.enable { |
120bcf4d IB |
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 | }; | |
5400b9b6 | 44 | security.acme.certs."irc" = config.myServices.ircCerts // { |
31a38b9f IB |
45 | domain = "irc.immae.eu"; |
46 | postRun = '' | |
47 | systemctl restart stunnel.service | |
48 | ''; | |
49 | }; | |
50 | ||
51 | networking.firewall.allowedTCPPorts = [ 6697 ]; | |
ffb14c1c | 52 | services.bitlbee = with pkgs; { |
31a38b9f IB |
53 | enable = true; |
54 | authMode = "Registered"; | |
55 | libpurple_plugins = [ | |
ffb14c1c IB |
56 | purple-hangouts |
57 | purple-matrix | |
17c6ac45 IB |
58 | purple-facebook |
59 | purple-googlechat | |
31a38b9f IB |
60 | ]; |
61 | plugins = [ | |
ffb14c1c IB |
62 | bitlbee-mastodon |
63 | bitlbee-facebook | |
64 | bitlbee-discord | |
65 | bitlbee-steam | |
31a38b9f IB |
66 | ]; |
67 | }; | |
68 | ||
69 | services.stunnel = { | |
70 | enable = true; | |
71 | servers = { | |
72 | bitlbee = { | |
73 | accept = 6697; | |
74 | connect = 6667; | |
5400b9b6 | 75 | cert = "${config.security.acme.certs.irc.directory}/full.pem"; |
31a38b9f IB |
76 | }; |
77 | }; | |
78 | }; | |
79 | }; | |
80 | } |