]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Refactor websites options
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 1 Jun 2019 10:51:51 +0000 (12:51 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sat, 1 Jun 2019 11:32:32 +0000 (13:32 +0200)
39 files changed:
modules/private/buildbot/default.nix
modules/private/certificates.nix
modules/private/tasks/default.nix
modules/private/websites/aten/integration.nix
modules/private/websites/aten/production.nix
modules/private/websites/capitaines/production.nix
modules/private/websites/chloe/integration.nix
modules/private/websites/chloe/production.nix
modules/private/websites/connexionswing/integration.nix
modules/private/websites/connexionswing/production.nix
modules/private/websites/default.nix
modules/private/websites/denisejerome/production.nix
modules/private/websites/emilia/production.nix
modules/private/websites/florian/app.nix
modules/private/websites/florian/integration.nix
modules/private/websites/florian/production.nix
modules/private/websites/immae/production.nix
modules/private/websites/immae/release.nix
modules/private/websites/immae/temp.nix
modules/private/websites/leila/production.nix
modules/private/websites/ludivinecassal/integration.nix
modules/private/websites/ludivinecassal/production.nix
modules/private/websites/nassime/production.nix
modules/private/websites/naturaloutil/production.nix
modules/private/websites/papa/surveillance.nix
modules/private/websites/piedsjaloux/integration.nix
modules/private/websites/piedsjaloux/production.nix
modules/private/websites/tools/cloud/default.nix
modules/private/websites/tools/dav/default.nix
modules/private/websites/tools/db/default.nix
modules/private/websites/tools/diaspora/default.nix
modules/private/websites/tools/ether/default.nix
modules/private/websites/tools/git/default.nix
modules/private/websites/tools/mastodon/default.nix
modules/private/websites/tools/mgoblin/default.nix
modules/private/websites/tools/peertube/default.nix
modules/private/websites/tools/tools/default.nix
modules/websites/default.nix
modules/websites/php-application.nix

index d023a835e83afc5f989496fc45b2e1dd0fe25e7a..f307606b0958ae29dcbc70d371b33fff737b7c91 100644 (file)
@@ -37,11 +37,11 @@ in
       extraGroups = [ "keys" ];
     };
 
-    services.websites.tools.watchPaths = lib.attrsets.mapAttrsToList
+    services.websites.env.tools.watchPaths = lib.attrsets.mapAttrsToList
       (k: project: "/var/secrets/buildbot/${project.name}/webhook-httpd-include")
       myconfig.env.buildbot.projects;
 
-    services.websites.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: ''
+    services.websites.env.tools.vhostConfs.git.extraConfig = lib.attrsets.mapAttrsToList (k: project: ''
         RedirectMatch permanent "^/buildbot/${project.name}$" "/buildbot/${project.name}/"
         RewriteEngine On
         RewriteRule ^/buildbot/${project.name}/ws(.*)$   unix:///run/buildbot/${project.name}.sock|ws://git.immae.eu/ws$1 [P,NE,QSA,L]
index 43f6a2343afafeba86880779f6aa66afc75c6447..2e40b3cd7a7f27f2febb40ef2075a310036173a8 100644 (file)
@@ -15,7 +15,7 @@
   };
 
   config = {
-    services.websitesCerts = config.services.myCertificates.certConfig;
+    services.websites.certs = config.services.myCertificates.certConfig;
     myServices.databasesCerts = config.services.myCertificates.certConfig;
     myServices.ircCerts = config.services.myCertificates.certConfig;
 
index 83a1b616b13934f567a6d509a5d4f76ac617a6db..a2da0c3e92d456251cd4d9c6f2f1b2c5bcb95fbe 100644 (file)
@@ -101,9 +101,9 @@ in {
           SetEnv TASKD_LDAP_FILTER   "${env.ldap.search}"
         '';
     }];
-    services.websites.tools.watchPaths = [ "/var/secrets/webapps/tools-taskwarrior-web" ];
-    services.websites.tools.modules = [ "proxy_fcgi" "sed" ];
-    services.websites.tools.vhostConfs.task = {
+    services.websites.env.tools.watchPaths = [ "/var/secrets/webapps/tools-taskwarrior-web" ];
+    services.websites.env.tools.modules = [ "proxy_fcgi" "sed" ];
+    services.websites.env.tools.vhostConfs.task = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "task.immae.eu" ];
index f8d8b53283cd8b79e1cf33f9bcfa241e85c7e9d5..0dbc4fa91495aedb835b05caec2eb09b287e3ed7 100644 (file)
@@ -32,7 +32,7 @@ in {
 
     secrets.keys = aten.keys;
     services.phpfpm.poolConfigs.aten_dev = aten.phpFpm.pool;
-    services.websites.integration.vhostConfs.aten = {
+    services.websites.env.integration.vhostConfs.aten = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "dev.aten.pro" ];
index 1a55e8a46cdc0ac178b4f656df9ea689a48c676e..0fab309213cdf8834b029961aaef72190fad999e 100644 (file)
@@ -21,15 +21,15 @@ in {
     services.phpfpm.poolConfigs.aten_prod = aten.phpFpm.pool;
     system.activationScripts.aten_prod = aten.activationScript;
     myServices.websites.webappDirs."${aten.apache.webappName}" = aten.app.webRoot;
-    services.websites.production.modules = aten.apache.modules;
-    services.websites.production.vhostConfs.aten = {
+    services.websites.env.production.modules = aten.apache.modules;
+    services.websites.env.production.vhostConfs.aten = {
       certName     = "aten";
       certMainHost = "aten.pro";
       hosts        = [ "aten.pro" "www.aten.pro" ];
       root         = aten.apache.root;
       extraConfig  = [ aten.apache.vhostConf ];
     };
-    services.websites.production.watchPaths = [
+    services.websites.env.production.watchPaths = [
       "/var/secrets/webapps/${aten.app.environment}-aten"
     ];
   };
index 57d878737a42eef9ed0c114990d7d02dae0ce06e..995e2cc333771c5f22e85774c6e3d85797ba2d29 100644 (file)
@@ -11,7 +11,7 @@ in {
   config = lib.mkIf cfg.enable {
     myServices.websites.webappDirs."${webappName}" = siteDir;
 
-    services.websites.production.vhostConfs.capitaines_mastodon = {
+    services.websites.env.production.vhostConfs.capitaines_mastodon = {
       certName     = "capitaines";
       certMainHost = "mastodon.capitaines.fr";
       hosts        = [ "mastodon.capitaines.fr" ];
@@ -28,7 +28,7 @@ in {
       ];
     };
 
-    services.websites.production.vhostConfs.capitaines = {
+    services.websites.env.production.vhostConfs.capitaines = {
       certName   = "capitaines";
       addToCerts = true;
       hosts      = [ "capitaines.fr" ];
index 25ec4db3a3d95e86cac1408b516134a7b69fa058..1f7ac3121e7dc84013e8d1bfffe1fcc8bc078ea0 100644 (file)
@@ -24,15 +24,15 @@ in {
     };
     system.activationScripts.chloe_dev = chloe.activationScript;
     myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
-    services.websites.integration.modules = chloe.apache.modules;
-    services.websites.integration.vhostConfs.chloe = {
+    services.websites.env.integration.modules = chloe.apache.modules;
+    services.websites.env.integration.vhostConfs.chloe = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["chloe.immae.eu" ];
       root        = chloe.apache.root;
       extraConfig = [ chloe.apache.vhostConf ];
     };
-    services.websites.integration.watchPaths = [
+    services.websites.env.integration.watchPaths = [
       "/var/secrets/webapps/${chloe.app.environment}-chloe"
     ];
   };
index 6e0c34d7d8cb6789361ca10dcf65c78106380871..6cfdb7f381580a05196207f24c571ab25f71dd4f 100644 (file)
@@ -26,15 +26,15 @@ in {
     };
     system.activationScripts.chloe_prod = chloe.activationScript;
     myServices.websites.webappDirs."${chloe.apache.webappName}" = chloe.app.webRoot;
-    services.websites.production.modules = chloe.apache.modules;
-    services.websites.production.vhostConfs.chloe = {
+    services.websites.env.production.modules = chloe.apache.modules;
+    services.websites.env.production.vhostConfs.chloe = {
       certName     = "chloe";
       certMainHost = "osteopathe-cc.fr";
       hosts        = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
       root         = chloe.apache.root;
       extraConfig  = [ chloe.apache.vhostConf ];
     };
-    services.websites.production.watchPaths = [
+    services.websites.env.production.watchPaths = [
       "/var/secrets/webapps/${chloe.app.environment}-chloe"
     ];
   };
index 7d77ac77f06e53b6c23f2a2a726e101541910dc2..795d532e210f35fe35340f858cc18ee14c466cfc 100644 (file)
@@ -23,8 +23,8 @@ in {
     };
     system.activationScripts.connexionswing_dev = connexionswing.activationScript;
     myServices.websites.webappDirs."${connexionswing.apache.webappName}" = connexionswing.app.webRoot;
-    services.websites.integration.modules = connexionswing.apache.modules;
-    services.websites.integration.vhostConfs.connexionswing = {
+    services.websites.env.integration.modules = connexionswing.apache.modules;
+    services.websites.env.integration.vhostConfs.connexionswing = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["connexionswing.immae.eu" "sandetludo.immae.eu" ];
index f4cb377236bdd2b3e5731b182d77f46db6422962..07647da266534568c68e3774ff7f095a2b56a97c 100644 (file)
@@ -25,8 +25,8 @@ in {
     };
     system.activationScripts.connexionswing_prod = connexionswing.activationScript;
     myServices.websites.webappDirs."${connexionswing.apache.webappName}" = connexionswing.app.webRoot;
-    services.websites.production.modules = connexionswing.apache.modules;
-    services.websites.production.vhostConfs.connexionswing = {
+    services.websites.env.production.modules = connexionswing.apache.modules;
+    services.websites.env.production.vhostConfs.connexionswing = {
       certName     = "connexionswing";
       certMainHost = "connexionswing.com";
       hosts        = ["connexionswing.com" "sandetludo.com" "www.connexionswing.com" "www.sandetludo.com" ];
index c3d941c2f5014b3867e12e54fe806aaff6883f90..0d420ea0905cd7c225c89e404631ba9c91f67db1 100644 (file)
@@ -142,7 +142,7 @@ in
     services.filesWatcher.httpdInte.paths = [ "/var/secrets/apache-ldap" ];
     services.filesWatcher.httpdTools.paths = [ "/var/secrets/apache-ldap" ];
 
-    services.websites.production = {
+    services.websites.env.production = {
       enable = true;
       adminAddr = "httpd@immae.eu";
       httpdName = "Prod";
@@ -159,7 +159,7 @@ in
       };
     };
 
-    services.websites.integration = {
+    services.websites.env.integration = {
       enable = true;
       adminAddr = "httpd@immae.eu";
       httpdName = "Inte";
@@ -176,7 +176,7 @@ in
       };
     };
 
-    services.websites.tools = {
+    services.websites.env.tools = {
       enable = true;
       adminAddr = "httpd@immae.eu";
       httpdName = "Tools";
index b5aff942384e839528d36ab01bb0af611be71280..f93ad37e0cfdf5c54b2a9329e8873320791fabcb 100644 (file)
@@ -9,7 +9,7 @@ in {
   config = lib.mkIf cfg.enable {
     services.webstats.sites = [ { name = "denisejerome.piedsjaloux.fr"; } ];
 
-    services.websites.production.vhostConfs.denisejerome = {
+    services.websites.env.production.vhostConfs.denisejerome = {
       certName     = "denisejerome";
       certMainHost = "denisejerome.piedsjaloux.fr";
       hosts        = ["denisejerome.piedsjaloux.fr" ];
index 13f008f74a1392ea79813428f6be6f010b530ca4..422bfd464423cf712b5747c8e058efcaac87c7bc 100644 (file)
@@ -47,7 +47,7 @@ in {
       install -m 0755 -o wwwrun -g wwwrun -d ${varDir}
       '';
     myServices.websites.webappDirs."${webappName}" = siteDir;
-    services.websites.production.vhostConfs.emilia = {
+    services.websites.env.production.vhostConfs.emilia = {
       certName     = "emilia";
       certMainHost = "saison-photo.org";
       hosts        = [ "saison-photo.org" "www.saison-photo.org" ];
index 55fb3cb232d03fec08ca67659d3e4729089eb1e4..00fe6448d93f263f29652a32c8effd3af5b2bda1 100644 (file)
@@ -21,8 +21,8 @@ in {
     services.phpfpm.poolConfigs.tellesflorian_dev = tellesflorian.phpFpm.pool;
     system.activationScripts.tellesflorian_dev = tellesflorian.activationScript;
     myServices.websites.webappDirs."${tellesflorian.apache.webappName}" = tellesflorian.app.webRoot;
-    services.websites.integration.modules = adminer.apache.modules ++ tellesflorian.apache.modules;
-    services.websites.integration.vhostConfs.tellesflorian = {
+    services.websites.env.integration.modules = adminer.apache.modules ++ tellesflorian.apache.modules;
+    services.websites.env.integration.vhostConfs.tellesflorian = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["app.tellesflorian.com" ];
index 424ebd48321b45d05a2b6a97554e68158c69e536..e444e69a5e23c41f4e5fd751dc1bcfa132176b13 100644 (file)
@@ -10,8 +10,8 @@ in {
   config = lib.mkIf cfg.enable {
     security.acme.certs."ftp".extraDomains."florian.immae.eu" = null;
 
-    services.websites.integration.modules = adminer.apache.modules;
-    services.websites.integration.vhostConfs.florian = {
+    services.websites.env.integration.modules = adminer.apache.modules;
+    services.websites.env.integration.vhostConfs.florian = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "florian.immae.eu" ];
index 9b310b8b6b6971790e5781a050ed004c4cf5d94d..44a262ec83dfdcac53b83f5c035a68dc6c2ee817 100644 (file)
@@ -10,8 +10,8 @@ in {
   config = lib.mkIf cfg.enable {
     security.acme.certs."ftp".extraDomains."tellesflorian.com" = null;
 
-    services.websites.production.modules = adminer.apache.modules;
-    services.websites.production.vhostConfs.florian = {
+    services.websites.env.production.modules = adminer.apache.modules;
+    services.websites.env.production.vhostConfs.florian = {
       certName     = "florian";
       certMainHost = "tellesflorian.com";
       hosts        = [ "tellesflorian.com" "www.tellesflorian.com" ];
index c3cabb6ae84e7fb51b469c3ce08eeb25efc403dc..3c851e68a37ccc9e7b9cba4f034b911484507515 100644 (file)
@@ -22,8 +22,8 @@ in {
 
       php_admin_value[open_basedir] = "${varDir}:/tmp"
       '';
-    services.websites.production.modules = [ "proxy_fcgi" ];
-    services.websites.production.vhostConfs.immae = {
+    services.websites.env.production.modules = [ "proxy_fcgi" ];
+    services.websites.env.production.vhostConfs.immae = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "www.immae.eu" ];
@@ -51,7 +51,7 @@ in {
       ];
     };
 
-    services.websites.production.vhostConfs.bouya = {
+    services.websites.env.production.vhostConfs.bouya = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "bouya.org" "www.bouya.org" ];
index 68381a6ac9f711cd5c78b4493830cad632cd8359..5cc35ee2ebb64312878c67312236ee339bbce639 100644 (file)
@@ -9,7 +9,7 @@ in {
   config = lib.mkIf cfg.enable {
     services.webstats.sites = [ { name = "release.immae.eu"; } ];
 
-    services.websites.production.vhostConfs.release = {
+    services.websites.env.production.vhostConfs.release = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "release.immae.eu" ];
index 0b2a3a3ed56f4210321f492c7d74642b2abaa264..288c8cc209461a320989bc0ce89f6cd031d0cff2 100644 (file)
@@ -7,8 +7,8 @@ in {
   options.myServices.websites.immae.temp.enable = lib.mkEnableOption "enable Temp' website";
 
   config = lib.mkIf cfg.enable {
-    services.websites.production.modules = [ "headers" ];
-    services.websites.production.vhostConfs.temp = {
+    services.websites.env.production.modules = [ "headers" ];
+    services.websites.env.production.vhostConfs.temp = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "temp.immae.eu" ];
index 69c8c4972a3011baaf95edb894e7208e1037e746..52cf8cf1476f3f28bbaf7162b530ffde784cfca3 100644 (file)
@@ -25,8 +25,8 @@ in {
       { name = "chorale.leila.bouya.org"; }
     ];
 
-    services.websites.production.modules = [ "proxy_fcgi" ];
-    services.websites.production.vhostConfs.leila_chorale = {
+    services.websites.env.production.modules = [ "proxy_fcgi" ];
+    services.websites.env.production.vhostConfs.leila_chorale = {
       certName    = "leila";
       addToCerts  = true;
       hosts       = [ "chorale.leila.bouya.org" "chorale-vocanta.fr.nf" "www.chorale-vocanta.fr.nf" ];
@@ -49,7 +49,7 @@ in {
           ''
       ];
     };
-    services.websites.production.vhostConfs.leila = {
+    services.websites.env.production.vhostConfs.leila = {
       certName     = "leila";
       certMainHost = "leila.bouya.org";
       hosts        = [ "leila.bouya.org" ];
index f0ef3a66a2796aba67c7485b2835a9cfe0fa4260..bc05d9bfe02f73eb71eb187bad60d28954a95511 100644 (file)
@@ -20,8 +20,8 @@ in {
     services.phpfpm.poolConfigs.ludivinecassal_dev = ludivinecassal.phpFpm.pool;
     system.activationScripts.ludivinecassal_dev = ludivinecassal.activationScript;
     myServices.websites.webappDirs."${ludivinecassal.apache.webappName}" = ludivinecassal.app.webRoot;
-    services.websites.integration.modules = ludivinecassal.apache.modules;
-    services.websites.integration.vhostConfs.ludivine = {
+    services.websites.env.integration.modules = ludivinecassal.apache.modules;
+    services.websites.env.integration.vhostConfs.ludivine = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "ludivine.immae.eu" ];
index 6a22d98474a51943f6d1b41903bc4f7eee699a08..9d8407de3e9b8a8d4b685f0e329bf397d57c9f03 100644 (file)
@@ -21,8 +21,8 @@ in {
     services.phpfpm.poolConfigs.ludivinecassal_prod = ludivinecassal.phpFpm.pool;
     system.activationScripts.ludivinecassal_prod = ludivinecassal.activationScript;
     myServices.websites.webappDirs."${ludivinecassal.apache.webappName}" = ludivinecassal.app.webRoot;
-    services.websites.production.modules = ludivinecassal.apache.modules;
-    services.websites.production.vhostConfs.ludivine = {
+    services.websites.env.production.modules = ludivinecassal.apache.modules;
+    services.websites.env.production.vhostConfs.ludivine = {
       certName     = "ludivinecassal";
       certMainHost = "ludivinecassal.com";
       hosts        = ["ludivinecassal.com" "www.ludivinecassal.com" ];
index a1097784c499be9c7199cd1652025ece0bc05380..f2a414232d68ffdf97ead9ebab7b8dadbdc33529 100644 (file)
@@ -11,7 +11,7 @@ in {
 
     security.acme.certs."ftp".extraDomains."nassime.bouya.org" = null;
 
-    services.websites.production.vhostConfs.nassime = {
+    services.websites.env.production.vhostConfs.nassime = {
       certName     = "nassime";
       certMainHost = "nassime.bouya.org";
       hosts        = ["nassime.bouya.org" ];
index f59957da12814c848bb2b1ef26ea0c5009e30d30..93940d5efc2a35d5921a38ff9e7c8424ce989537 100644 (file)
@@ -61,8 +61,8 @@ in {
         extension=${pkgs.php}/lib/php/extensions/mysqli.so
         '';
     };
-    services.websites.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ];
-    services.websites.production.vhostConfs.naturaloutil = {
+    services.websites.env.production.modules = adminer.apache.modules ++ [ "proxy_fcgi" ];
+    services.websites.env.production.vhostConfs.naturaloutil = {
       certName     = "naturaloutil";
       certMainHost = "naturaloutil.immae.eu";
       hosts        = ["naturaloutil.immae.eu" ];
index 8e7cd9db83d830f8f9cf7ec5872f951b1c86471e..ca6bf9ea14badd154e98196edc8c96df003dcc57 100644 (file)
@@ -27,7 +27,7 @@ in {
       ];
     };
 
-    services.websites.production.vhostConfs.papa = {
+    services.websites.env.production.vhostConfs.papa = {
       certName     = "papa";
       certMainHost = "surveillance.maison.bbc.bouya.org";
       hosts        = [ "surveillance.maison.bbc.bouya.org" ];
index 5f574e1af3aa1d5dfacf088a17d2bf6b8508ceaf..8007c918f739614a543a8f84962ae5b8eaeee21e 100644 (file)
@@ -19,8 +19,8 @@ in {
     services.phpfpm.poolConfigs.piedsjaloux_dev = piedsjaloux.phpFpm.pool;
     system.activationScripts.piedsjaloux_dev = piedsjaloux.activationScript;
     myServices.websites.webappDirs."${piedsjaloux.apache.webappName}" = piedsjaloux.app.webRoot;
-    services.websites.integration.modules = piedsjaloux.apache.modules;
-    services.websites.integration.vhostConfs.piedsjaloux = {
+    services.websites.env.integration.modules = piedsjaloux.apache.modules;
+    services.websites.env.integration.vhostConfs.piedsjaloux = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "piedsjaloux.immae.eu" ];
index e3bd2ddcc37742de8b5094b6e47cd848902d9bb7..30066a595f61205f11b36d6de7f2dde98afced54 100644 (file)
@@ -21,8 +21,8 @@ in {
     services.phpfpm.poolConfigs.piedsjaloux_prod = piedsjaloux.phpFpm.pool;
     system.activationScripts.piedsjaloux_prod = piedsjaloux.activationScript;
     myServices.websites.webappDirs."${piedsjaloux.apache.webappName}" = piedsjaloux.app.webRoot;
-    services.websites.production.modules = piedsjaloux.apache.modules;
-    services.websites.production.vhostConfs.piedsjaloux = {
+    services.websites.env.production.modules = piedsjaloux.apache.modules;
+    services.websites.env.production.vhostConfs.piedsjaloux = {
       certName     = "piedsjaloux";
       certMainHost = "piedsjaloux.fr";
       hosts        = [ "piedsjaloux.fr" "www.piedsjaloux.fr" ];
index ceb8f77203f4c121405ad58f0927cdaf5ed2614c..fffe04ca4076101fc484b0fa797cbe734936113d 100644 (file)
@@ -48,9 +48,9 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
-    services.websites.tools.modules = [ "proxy_fcgi" ];
+    services.websites.env.tools.modules = [ "proxy_fcgi" ];
 
-    services.websites.tools.vhostConfs.cloud = {
+    services.websites.env.tools.vhostConfs.cloud = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["cloud.immae.eu" ];
index fb0baaece9f034441871b8fbbee932ece46bb263..5a0f4704f74df2bc50050c66a3e782de3439962d 100644 (file)
@@ -29,9 +29,9 @@ in {
   config = lib.mkIf cfg.enable {
     system.activationScripts.davical = davical.activationScript;
     secrets.keys = davical.keys;
-    services.websites.tools.modules = davical.apache.modules;
+    services.websites.env.tools.modules = davical.apache.modules;
 
-    services.websites.tools.vhostConfs.dav = {
+    services.websites.env.tools.vhostConfs.dav = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["dav.immae.eu" ];
index 361e204d8efd9af97055c61be0e499ac8e532db9..60592e5b329dda802474fc6ef8e289d956136515 100644 (file)
@@ -9,8 +9,8 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
-    services.websites.tools.modules = adminer.apache.modules;
-    services.websites.tools.vhostConfs.db-1 = {
+    services.websites.env.tools.modules = adminer.apache.modules;
+    services.websites.env.tools.vhostConfs.db-1 = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["db-1.immae.eu" ];
index 6742a8108d437ad56c176b7efca1d6749f0d9afe..17a6a099fb87285ec7a2ea077225a9d31855bd76 100644 (file)
@@ -150,14 +150,14 @@ in {
       paths = [ dcfg.configDir ];
     };
 
-    services.websites.tools.modules = [
+    services.websites.env.tools.modules = [
       "headers" "proxy" "proxy_http"
     ];
     system.extraSystemBuilderCmds = ''
       mkdir -p $out/webapps
       ln -s ${dcfg.workdir}/public/ $out/webapps/tools_diaspora
       '';
-    services.websites.tools.vhostConfs.diaspora = {
+    services.websites.env.tools.vhostConfs.diaspora = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "diaspora.immae.eu" ];
index 3e68d54e5ee2fbe3d4834f08fec4fa3a4ef019d3..c03852812143ce8281104272f4d3c42656faa625 100644 (file)
@@ -138,10 +138,10 @@ in {
       paths = [ ecfg.sessionKeyFile ecfg.apiKeyFile ecfg.configFile ];
     };
 
-    services.websites.tools.modules = [
+    services.websites.env.tools.modules = [
       "headers" "proxy" "proxy_http" "proxy_wstunnel"
     ];
-    services.websites.tools.vhostConfs.etherpad-lite = {
+    services.websites.env.tools.vhostConfs.etherpad-lite = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "ether.immae.eu" ];
index 75d024020b527c76c6c3ca3dc0179c775d8bd34a..d66d15119168b1eed32960dcecee17afe45f3d3e 100644 (file)
@@ -16,14 +16,14 @@ in {
 
   config = lib.mkIf cfg.enable {
     secrets.keys = mantisbt.keys;
-    services.websites.tools.modules =
+    services.websites.env.tools.modules =
       gitweb.apache.modules ++
       mantisbt.apache.modules;
     myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot;
     myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot;
 
     system.activationScripts.mantisbt = mantisbt.activationScript;
-    services.websites.tools.vhostConfs.git = {
+    services.websites.env.tools.vhostConfs.git = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["git.immae.eu" ];
index 1a4b387c769a3cd55cf568afd7181dbbc4de1186..d67ae2bcb35580dd3ae46c1ea5bc0eefe6514802 100644 (file)
@@ -77,14 +77,14 @@ in {
     };
 
 
-    services.websites.tools.modules = [
+    services.websites.env.tools.modules = [
       "headers" "proxy" "proxy_wstunnel" "proxy_http"
     ];
     system.extraSystemBuilderCmds = ''
       mkdir -p $out/webapps
       ln -s ${mcfg.workdir}/public/ $out/webapps/tools_mastodon
       '';
-    services.websites.tools.vhostConfs.mastodon = {
+    services.websites.env.tools.vhostConfs.mastodon = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["mastodon.immae.eu" ];
index 1d398db24ebecf20e6b39ee483af6ecb18cc5929..b99b95e982ed601853e675d2e11f8e87b3e43a71 100644 (file)
@@ -87,11 +87,11 @@ in {
       paths = [ mcfg.configFile ];
     };
 
-    services.websites.tools.modules = [
+    services.websites.env.tools.modules = [
       "proxy" "proxy_http"
     ];
     users.users.wwwrun.extraGroups = [ "mediagoblin" ];
-    services.websites.tools.vhostConfs.mgoblin = {
+    services.websites.env.tools.vhostConfs.mgoblin = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["mgoblin.immae.eu" ];
index dd2853039a33db38beda72d1461cdbdd8e8ebed9..f34acaa6c9cba892e74561f50f61c4afa56c00cc 100644 (file)
@@ -150,7 +150,7 @@ in {
         '';
     }];
 
-    services.websites.tools.modules = [
+    services.websites.env.tools.modules = [
       "headers" "proxy" "proxy_http" "proxy_wstunnel"
     ];
     services.filesWatcher.peertube = {
@@ -158,7 +158,7 @@ in {
       paths = [ pcfg.configFile ];
     };
 
-    services.websites.tools.vhostConfs.peertube = {
+    services.websites.env.tools.vhostConfs.peertube = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = [ "peertube.immae.eu" ];
index d75def47fdebcf2cf94d57e139fda2f44388a755..5ca9851175025f18ac6f7bfe723171eac588ffe6 100644 (file)
@@ -57,10 +57,10 @@ in {
       ++ wallabag.keys
       ++ yourls.keys;
 
-    services.websites.integration.modules =
+    services.websites.env.integration.modules =
       rainloop.apache.modules;
 
-    services.websites.tools.modules =
+    services.websites.env.tools.modules =
       [ "proxy_fcgi" ]
       ++ adminer.apache.modules
       ++ ympd.apache.modules
@@ -74,7 +74,7 @@ in {
       ++ ldap.apache.modules
       ++ kanboard.apache.modules;
 
-    services.websites.integration.vhostConfs.devtools = {
+    services.websites.env.integration.vhostConfs.devtools = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["devtools.immae.eu" ];
@@ -94,7 +94,7 @@ in {
       ];
     };
 
-    services.websites.tools.vhostConfs.tools = {
+    services.websites.env.tools.vhostConfs.tools = {
       certName    = "eldiron";
       addToCerts  = true;
       hosts       = ["tools.immae.eu" ];
@@ -124,7 +124,7 @@ in {
       ];
     };
 
-    services.websites.tools.vhostConfs.outils = {
+    services.websites.env.tools.vhostConfs.outils = {
       certName   = "eldiron";
       addToCerts = true;
       hosts      = [ "outils.immae.eu" ];
@@ -302,7 +302,7 @@ in {
       "${kanboard.apache.webappName}" = kanboard.webRoot;
     };
 
-    services.websites.tools.watchPaths = [
+    services.websites.env.tools.watchPaths = [
       "/var/secrets/webapps/tools-wallabag"
     ];
     services.filesWatcher.phpfpm-wallabag = {
index 2e1d23a48764a50b16fe3210a461b08e1b4601fb..ef79cb3cbf77b52f604746607e878f03890b604c 100644 (file)
 { lib, config, ... }: with lib;
 let
-  cfg = {
-    certs = config.services.websitesCerts;
-    webappDirs = config.services.websitesWebappDirs;
-    env = config.services.websites;
-  };
+  cfg = config.services.websites;
 in
 {
-  options.services.websitesCerts = mkOption {
-    description = "Default websites configuration for certificates as accepted by acme";
-  };
-  options.services.websitesWebappDirs = mkOption {
-    description = ''
-      Defines a symlink between /run/current-system/webapps and a store
-      app directory to be used in http configuration. Permits to avoid
-      restarting httpd when only the folder name changes.
-      '';
-    type = types.attrsOf types.path;
-    default = {};
-  };
-  # TODO: ajouter /run/current-system/webapps (RO) et webapps (RW)
-  options.services.websites = with types; mkOption {
-    default = {};
-    description = "Each type of website to enable will target a distinct httpd server";
-    type = attrsOf (submodule {
-      options = {
-        enable = mkEnableOption "Enable websites of this type";
-        adminAddr = mkOption {
-          type = str;
-          description = "Admin e-mail address of the instance";
-        };
-        httpdName = mkOption {
-          type = str;
-          description = "Name of the httpd instance to assign this type to";
-        };
-        ips = mkOption {
-          type = listOf string;
-          default = [];
-          description = "ips to listen to";
-        };
-        modules = mkOption {
-          type = listOf str;
-          default = [];
-          description = "Additional modules to load in Apache";
-        };
-        extraConfig = mkOption {
-          type = listOf lines;
-          default = [];
-          description = "Additional configuration to append to Apache";
-        };
-        nosslVhost = mkOption {
-          description = "A default nossl vhost for captive portals";
-          default = {};
-          type = submodule {
-            options = {
-              enable = mkEnableOption "Add default no-ssl vhost for this instance";
-              host = mkOption {
-                type = string;
-                description = "The hostname to use for this vhost";
-              };
-              root = mkOption {
-                type = path;
-                default = ./nosslVhost;
-                description = "The root folder to serve";
-              };
-              indexFile = mkOption {
-                type = string;
-                default = "index.html";
-                description = "The index file to show.";
+  options.services.websites = with types; {
+    certs = mkOption {
+      description = "Default websites configuration for certificates as accepted by acme";
+    };
+    webappDirs = mkOption {
+      description = ''
+        Defines a symlink between /run/current-system/webapps and a store
+        app directory to be used in http configuration. Permits to avoid
+        restarting httpd when only the folder name changes.
+        '';
+      type = types.attrsOf types.path;
+      default = {};
+    };
+    webappDirsName = mkOption {
+      type = str;
+      default = "webapps";
+      description = ''
+        Name of the webapp dir to create in /run/current-system
+        '';
+    };
+    webappDirsPath = mkOption {
+      type = str;
+      readOnly = true;
+      description = ''
+        Full path of the webapp dir
+        '';
+      default = "/run/current-system/${cfg.webappDirsName}";
+    };
+    env = mkOption {
+      default = {};
+      description = "Each type of website to enable will target a distinct httpd server";
+      type = attrsOf (submodule {
+        options = {
+          enable = mkEnableOption "Enable websites of this type";
+          adminAddr = mkOption {
+            type = str;
+            description = "Admin e-mail address of the instance";
+          };
+          httpdName = mkOption {
+            type = str;
+            description = "Name of the httpd instance to assign this type to";
+          };
+          ips = mkOption {
+            type = listOf string;
+            default = [];
+            description = "ips to listen to";
+          };
+          modules = mkOption {
+            type = listOf str;
+            default = [];
+            description = "Additional modules to load in Apache";
+          };
+          extraConfig = mkOption {
+            type = listOf lines;
+            default = [];
+            description = "Additional configuration to append to Apache";
+          };
+          nosslVhost = mkOption {
+            description = "A default nossl vhost for captive portals";
+            default = {};
+            type = submodule {
+              options = {
+                enable = mkEnableOption "Add default no-ssl vhost for this instance";
+                host = mkOption {
+                  type = string;
+                  description = "The hostname to use for this vhost";
+                };
+                root = mkOption {
+                  type = path;
+                  default = ./nosslVhost;
+                  description = "The root folder to serve";
+                };
+                indexFile = mkOption {
+                  type = string;
+                  default = "index.html";
+                  description = "The index file to show.";
+                };
               };
             };
           };
-        };
-        fallbackVhost = mkOption {
-          description = "The fallback vhost that will be defined as first vhost in Apache";
-          type = submodule {
-            options = {
-              certName = mkOption { type = string; };
-              hosts    = mkOption { type = listOf string; };
-              root     = mkOption { type = nullOr path; };
-              extraConfig = mkOption { type = listOf lines; default = []; };
+          fallbackVhost = mkOption {
+            description = "The fallback vhost that will be defined as first vhost in Apache";
+            type = submodule {
+              options = {
+                certName = mkOption { type = string; };
+                hosts    = mkOption { type = listOf string; };
+                root     = mkOption { type = nullOr path; };
+                extraConfig = mkOption { type = listOf lines; default = []; };
+              };
             };
           };
-        };
-        vhostConfs = mkOption {
-          default = {};
-          description = "List of vhosts to define for Apache";
-          type = attrsOf (submodule {
-            options = {
-              certName = mkOption { type = string; };
-              addToCerts = mkOption {
-                type = bool;
-                default = false;
-                description = "Use these to certificates. Is ignored (considered true) if certMainHost is not null";
-              };
-              certMainHost = mkOption {
-                type = nullOr string;
-                description = "Use that host as 'main host' for acme certs";
-                default = null;
+          vhostConfs = mkOption {
+            default = {};
+            description = "List of vhosts to define for Apache";
+            type = attrsOf (submodule {
+              options = {
+                certName = mkOption { type = string; };
+                addToCerts = mkOption {
+                  type = bool;
+                  default = false;
+                  description = "Use these to certificates. Is ignored (considered true) if certMainHost is not null";
+                };
+                certMainHost = mkOption {
+                  type = nullOr string;
+                  description = "Use that host as 'main host' for acme certs";
+                  default = null;
+                };
+                hosts    = mkOption { type = listOf string; };
+                root     = mkOption { type = nullOr path; };
+                extraConfig = mkOption { type = listOf lines; default = []; };
               };
-              hosts    = mkOption { type = listOf string; };
-              root     = mkOption { type = nullOr path; };
-              extraConfig = mkOption { type = listOf lines; default = []; };
-            };
-          });
-        };
-        watchPaths = mkOption {
-          type = listOf string;
-          default = [];
-          description = ''
-            Paths to watch that should trigger a reload of httpd
-            '';
+            });
+          };
+          watchPaths = mkOption {
+            type = listOf string;
+            default = [];
+            description = ''
+              Paths to watch that should trigger a reload of httpd
+              '';
+          };
         };
-      };
-    });
+      });
+    };
   };
 
   config.services.httpd = let
@@ -226,7 +238,10 @@ in
   ) groupedCerts;
 
   config.system.extraSystemBuilderCmds = lib.mkIf (builtins.length (builtins.attrValues cfg.webappDirs) > 0) ''
-    mkdir -p $out/webapps
-    ${builtins.concatStringsSep "\n" (attrsets.mapAttrsToList (name: path: "ln -s ${path} $out/webapps/${name}") cfg.webappDirs)}
+    mkdir -p $out/${cfg.webappDirsName}
+    ${builtins.concatStringsSep "\n"
+      (attrsets.mapAttrsToList
+        (name: path: "ln -s ${path} $out/${cfg.webappDirsName}/${name}") cfg.webappDirs)
+    }
   '';
 }
index 7bbae50a943fbf5b8ffb95e951d7f724aa6dc7d9..765d40677fe9d5fb18398ac077246c4b70f5a870 100644 (file)
@@ -97,14 +97,14 @@ in
   };
 
   config = {
-    services.websites = attrsets.mapAttrs' (name: cfgs: attrsets.nameValuePair
+    services.websites.env = attrsets.mapAttrs' (name: cfgs: attrsets.nameValuePair
       name {
         modules = [ "proxy_fcgi" ];
         watchPaths = builtins.concatLists (map (c: c.watchFiles) cfgs);
       }
     ) cfgByEnv;
 
-    services.websitesWebappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
+    services.websites.webappDirs = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
       icfg.webappName icfg.webRoot
     ) (attrsets.filterAttrs (n: v: !isNull v.webappName && !isNull v.webRoot) cfg);