]>
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 { |
5400b9b6 | 20 | security.acme.certs."irc" = config.myServices.ircCerts // { |
31a38b9f IB |
21 | domain = "irc.immae.eu"; |
22 | postRun = '' | |
23 | systemctl restart stunnel.service | |
24 | ''; | |
25 | }; | |
26 | ||
27 | networking.firewall.allowedTCPPorts = [ 6697 ]; | |
ffb14c1c | 28 | services.bitlbee = with pkgs; { |
31a38b9f IB |
29 | enable = true; |
30 | authMode = "Registered"; | |
31 | libpurple_plugins = [ | |
ffb14c1c IB |
32 | purple-hangouts |
33 | purple-matrix | |
31a38b9f IB |
34 | ]; |
35 | plugins = [ | |
ffb14c1c IB |
36 | bitlbee-mastodon |
37 | bitlbee-facebook | |
38 | bitlbee-discord | |
39 | bitlbee-steam | |
31a38b9f IB |
40 | ]; |
41 | }; | |
42 | ||
43 | services.stunnel = { | |
44 | enable = true; | |
45 | servers = { | |
46 | bitlbee = { | |
47 | accept = 6697; | |
48 | connect = 6667; | |
5400b9b6 | 49 | cert = "${config.security.acme.certs.irc.directory}/full.pem"; |
31a38b9f IB |
50 | }; |
51 | }; | |
52 | }; | |
53 | }; | |
54 | } |