blob: b3fe91f40bd66d854e0f4e3deda73c5a70f90cf6 (
plain) (
tree)
|
|
{ lib, pkgs, config, ... }:
let
cfg = config.myServices.irc;
in
{
options.myServices = {
ircCerts = lib.mkOption {
description = "Default ircconfigurations for certificates as accepted by acme";
};
irc.enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Whether to enable irc stuff.
'';
};
};
config = lib.mkIf cfg.enable {
security.acme.certs."irc" = config.myServices.ircCerts // {
domain = "irc.immae.eu";
postRun = ''
systemctl restart stunnel.service
'';
};
networking.firewall.allowedTCPPorts = [ 6697 ];
services.bitlbee = with pkgs; {
enable = true;
authMode = "Registered";
libpurple_plugins = [
purple-hangouts
purple-matrix
];
plugins = [
bitlbee-mastodon
bitlbee-facebook
bitlbee-discord
bitlbee-steam
];
};
services.stunnel = {
enable = true;
servers = {
bitlbee = {
accept = 6697;
connect = 6667;
cert = "${config.security.acme.directory}/irc/full.pem";
};
};
};
};
}
|