]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Move irc services to modules
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 16 May 2019 23:53:31 +0000 (01:53 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 16 May 2019 23:53:31 +0000 (01:53 +0200)
modules/private/default.nix
modules/private/irc.nix [moved from nixops/modules/irc.nix with 55% similarity]
nixops/eldiron.nix
nixops/modules/certificates.nix

index a7a23c220475cc66821c542a19cbe3465b27b724..20303150b2e8fae017234e5afcd2c37b313c7bb2 100644 (file)
@@ -9,4 +9,6 @@
   openldap   = ./databases/openldap;
   postgresql = ./databases/postgresql.nix;
   redis      = ./databases/redis.nix;
+
+  irc = ./irc.nix;
 }
similarity index 55%
rename from nixops/modules/irc.nix
rename to modules/private/irc.nix
index 363bfef6b3b6f3801e78e5f6f6548f2d57d247a8..b3fe91f40bd66d854e0f4e3deda73c5a70f90cf6 100644 (file)
@@ -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
     };
 
     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
       ];
     };
 
index 37f901e5e39855b63d3da7167c04e3914b03604d..a0c5c7c1a5a51347e4567d600dcf2e081ef157ec 100644 (file)
       ./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;
index 72896fdab6b0ccb7fb2be272e82740d13897a78a..43f6a2343afafeba86880779f6aa66afc75c6447 100644 (file)
@@ -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;