From: Ismaƫl Bouya Date: Thu, 16 May 2019 23:53:31 +0000 (+0200) Subject: Move irc services to modules X-Git-Tag: nur_publish~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=ffb14c1c25280777f5db3d2129c48dd319381f65;p=perso%2FImmae%2FConfig%2FNix.git Move irc services to modules --- diff --git a/modules/private/default.nix b/modules/private/default.nix index a7a23c2..2030315 100644 --- a/modules/private/default.nix +++ b/modules/private/default.nix @@ -9,4 +9,6 @@ openldap = ./databases/openldap; postgresql = ./databases/postgresql.nix; redis = ./databases/redis.nix; + + irc = ./irc.nix; } diff --git a/nixops/modules/irc.nix b/modules/private/irc.nix similarity index 55% rename from nixops/modules/irc.nix rename to modules/private/irc.nix index 363bfef..b3fe91f 100644 --- a/nixops/modules/irc.nix +++ b/modules/private/irc.nix @@ -1,7 +1,13 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: +let + cfg = config.myServices.irc; +in { - options = { - services.irc.enable = lib.mkOption { + 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 = '' @@ -10,8 +16,8 @@ }; }; - config = lib.mkIf config.services.irc.enable { - security.acme.certs."irc" = config.services.myCertificates.certConfig // { + config = lib.mkIf cfg.enable { + security.acme.certs."irc" = config.myServices.ircCerts // { domain = "irc.immae.eu"; postRun = '' systemctl restart stunnel.service @@ -19,18 +25,18 @@ }; networking.firewall.allowedTCPPorts = [ 6697 ]; - services.bitlbee = { + services.bitlbee = with pkgs; { enable = true; authMode = "Registered"; libpurple_plugins = [ - pkgs.purple-hangouts - pkgs.purple-matrix + purple-hangouts + purple-matrix ]; plugins = [ - pkgs.bitlbee-mastodon - pkgs.bitlbee-facebook - pkgs.bitlbee-discord - pkgs.bitlbee-steam + bitlbee-mastodon + bitlbee-facebook + bitlbee-discord + bitlbee-steam ]; }; diff --git a/nixops/eldiron.nix b/nixops/eldiron.nix index 37f901e..a0c5c7c 100644 --- a/nixops/eldiron.nix +++ b/nixops/eldiron.nix @@ -41,14 +41,13 @@ ./modules/ftp.nix ./modules/pub ./modules/task - ./modules/irc.nix ./modules/buildbot ./modules/dns.nix ] ++ (builtins.attrValues (import ../modules)); myServices.databases.enable = true; + myServices.irc.enable = true; services.myGitolite.enable = true; services.pure-ftpd.enable = true; - services.irc.enable = true; services.pub.enable = true; services.myTasks.enable = true; services.buildbot.enable = true; diff --git a/nixops/modules/certificates.nix b/nixops/modules/certificates.nix index 72896fd..43f6a23 100644 --- a/nixops/modules/certificates.nix +++ b/nixops/modules/certificates.nix @@ -17,6 +17,7 @@ config = { services.websitesCerts = config.services.myCertificates.certConfig; myServices.databasesCerts = config.services.myCertificates.certConfig; + myServices.ircCerts = config.services.myCertificates.certConfig; security.acme.preliminarySelfsigned = true;