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