]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/irc.nix
Add filesWatcher flake
[perso/Immae/Config/Nix.git] / modules / private / irc.nix
CommitLineData
ffb14c1c
IB
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.irc;
4in
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 {
d2e703c5 20 services.duplyBackup.profiles.irc = {
6a8252b1
IB
21 rootDir = "/var/lib/bitlbee";
22 };
5400b9b6 23 security.acme.certs."irc" = config.myServices.ircCerts // {
31a38b9f
IB
24 domain = "irc.immae.eu";
25 postRun = ''
26 systemctl restart stunnel.service
27 '';
28 };
29
30 networking.firewall.allowedTCPPorts = [ 6697 ];
ffb14c1c 31 services.bitlbee = with pkgs; {
31a38b9f
IB
32 enable = true;
33 authMode = "Registered";
34 libpurple_plugins = [
ffb14c1c
IB
35 purple-hangouts
36 purple-matrix
31a38b9f
IB
37 ];
38 plugins = [
ffb14c1c
IB
39 bitlbee-mastodon
40 bitlbee-facebook
41 bitlbee-discord
42 bitlbee-steam
31a38b9f
IB
43 ];
44 };
45
46 services.stunnel = {
47 enable = true;
48 servers = {
49 bitlbee = {
50 accept = 6697;
51 connect = 6667;
5400b9b6 52 cert = "${config.security.acme.certs.irc.directory}/full.pem";
31a38b9f
IB
53 };
54 };
55 };
56 };
57}