]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/irc.nix
Move irc services to modules
[perso/Immae/Config/Nix.git] / modules / private / irc.nix
1 { lib, pkgs, config, ... }:
2 let
3 cfg = config.myServices.irc;
4 in
5 {
6 options.myServices = {
7 ircCerts = lib.mkOption {
8 description = "Default ircconfigurations for certificates as accepted by acme";
9 };
10 irc.enable = lib.mkOption {
11 type = lib.types.bool;
12 default = false;
13 description = ''
14 Whether to enable irc stuff.
15 '';
16 };
17 };
18
19 config = lib.mkIf cfg.enable {
20 security.acme.certs."irc" = config.myServices.ircCerts // {
21 domain = "irc.immae.eu";
22 postRun = ''
23 systemctl restart stunnel.service
24 '';
25 };
26
27 networking.firewall.allowedTCPPorts = [ 6697 ];
28 services.bitlbee = with pkgs; {
29 enable = true;
30 authMode = "Registered";
31 libpurple_plugins = [
32 purple-hangouts
33 purple-matrix
34 ];
35 plugins = [
36 bitlbee-mastodon
37 bitlbee-facebook
38 bitlbee-discord
39 bitlbee-steam
40 ];
41 };
42
43 services.stunnel = {
44 enable = true;
45 servers = {
46 bitlbee = {
47 accept = 6697;
48 connect = 6667;
49 cert = "${config.security.acme.directory}/irc/full.pem";
50 };
51 };
52 };
53 };
54 }