From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- systems/eldiron/irc.nix | 80 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 systems/eldiron/irc.nix (limited to 'systems/eldiron/irc.nix') diff --git a/systems/eldiron/irc.nix b/systems/eldiron/irc.nix new file mode 100644 index 0000000..c48a4b3 --- /dev/null +++ b/systems/eldiron/irc.nix @@ -0,0 +1,80 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.myServices.irc; +in +{ + options.myServices = { + irc.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable irc stuff. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + myServices.dns.zones."immae.eu".subdomains.irc = + with config.myServices.dns.helpers; ips servers.eldiron.ips.main; + + myServices.chatonsProperties.services.bitlbee = { + file.datetime = "2022-08-27T19:00:00"; + service = { + name = "Bitlbee"; + description = "An IRC to other chat networks gateway"; + logo = "https://www.bitlbee.org/style/logo.png"; + website = "irc.immae.eu"; + status.level = "OK"; + status.description = "OK"; + registration."" = ["MEMBER" "CLIENT"]; + registration.load = "FULL"; + install.type = "PACKAGE"; + }; + software = { + name = "BitlBee"; + website = "https://www.bitlbee.org/"; + license.url = "https://github.com/bitlbee/bitlbee/blob/master/COPYING"; + license.name = "GNU General Public License v2.0"; + version = pkgs.bitlbee.version; + source.url = "https://github.com/bitlbee/bitlbee"; + modules = map (a: a.pname) config.services.bitlbee.plugins + ++ map (a: a.pname) config.services.bitlbee.libpurple_plugins; + }; + }; + security.acme.certs."irc" = { + 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 + purple-facebook + purple-googlechat + ]; + plugins = [ + bitlbee-mastodon + bitlbee-facebook + bitlbee-discord + bitlbee-steam + ]; + }; + + services.stunnel = { + enable = true; + servers = { + bitlbee = { + accept = 6697; + connect = 6667; + cert = "${config.security.acme.certs.irc.directory}/full.pem"; + }; + }; + }; + }; +} -- cgit v1.2.3