]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add iridologie website
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 24 Dec 2019 12:59:54 +0000 (13:59 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 24 Dec 2019 12:59:54 +0000 (13:59 +0100)
modules/private/default.nix
modules/private/environment.nix
modules/private/websites/default.nix
modules/private/websites/isabelle/aten_integration.nix [moved from modules/private/websites/aten/integration.nix with 92% similarity]
modules/private/websites/isabelle/aten_production.nix [moved from modules/private/websites/aten/production.nix with 92% similarity]
modules/private/websites/isabelle/iridologie.nix [new file with mode: 0644]

index be39993ee2948160e0bce7140791da104703139b..30b9df637830209533dbedc8b20aed55fa6dbfb6 100644 (file)
@@ -16,8 +16,9 @@ set = {
   openldapReplication = ./databases/openldap_replication.nix;
 
   websites = ./websites;
-  atenInte = ./websites/aten/integration.nix;
-  atenProd = ./websites/aten/production.nix;
+  isabelleAtenInte = ./websites/isabelle/aten_integration.nix;
+  isabelleAtenProd = ./websites/isabelle/aten_production.nix;
+  isabelleIridologie = ./websites/isabelle/iridologie.nix;
   capitainesProd = ./websites/capitaines/production.nix;
   chloeInte = ./websites/chloe/integration.nix;
   chloeProd = ./websites/chloe/production.nix;
index f0e39e9ca3d70aa64acfc030f588587f4fdee3ea..15e8f5489f56729d4f00d471cb49c04ed8746f32 100644 (file)
@@ -951,8 +951,8 @@ in
       description = "Websites configurations";
       type = submodule {
         options = {
-          aten = mkOption {
-            description = "Aten configurations by environment";
+          isabelle = mkOption {
+            description = "Isabelle configurations by environment";
             type =
               let
                 atenSubmodule = mkOption {
@@ -968,8 +968,8 @@ in
               in
                 submodule {
                   options = {
-                    production = atenSubmodule;
-                    integration = atenSubmodule;
+                    aten_production = atenSubmodule;
+                    aten_integration = atenSubmodule;
                   };
                 };
           };
index dcbbef85c8dc30160934aa9729ef1b68e70ce3bc..7f3e463166825b1533cd2dde4e82c96ce2c3c1c1 100644 (file)
@@ -224,8 +224,9 @@ in
         _theme = pkgs.webapps.apache-theme.theme;
       };
 
-      aten.integration.enable = true;
-      aten.production.enable = true;
+      isabelle.aten_integration.enable = true;
+      isabelle.aten_production.enable = true;
+      isabelle.iridologie.enable = true;
 
       capitaines.production.enable = true;
 
similarity index 92%
rename from modules/private/websites/aten/integration.nix
rename to modules/private/websites/isabelle/aten_integration.nix
index 7e12b389caa945a93b936ac4319d007a81e6756d..c8ca03f142a3e76f9a4e8edf470d100ff11513ba 100644 (file)
@@ -1,11 +1,11 @@
 { lib, pkgs, config,  ... }:
 let
-  secrets = config.myEnv.websites.aten.integration;
+  secrets = config.myEnv.websites.isabelle.aten_integration;
   app = pkgs.webapps.aten.override { environment = secrets.environment; };
-  cfg = config.myServices.websites.aten.integration;
+  cfg = config.myServices.websites.isabelle.aten_integration;
   pcfg = config.services.phpApplication;
 in {
-  options.myServices.websites.aten.integration.enable = lib.mkEnableOption "enable Aten's website in integration";
+  options.myServices.websites.isabelle.aten_integration.enable = lib.mkEnableOption "enable Aten's website in integration";
 
   config = lib.mkIf cfg.enable {
     services.duplyBackup.profiles.aten_dev.rootDir = app.varDir;
similarity index 92%
rename from modules/private/websites/aten/production.nix
rename to modules/private/websites/isabelle/aten_production.nix
index 1f72e61b9a15154d5ad2c365623527a35659278f..8e33f0f26b30680ea1abd40ea384977306bf7ea6 100644 (file)
@@ -1,11 +1,11 @@
 { lib, pkgs, config,  ... }:
 let
-  secrets = config.myEnv.websites.aten.production;
+  secrets = config.myEnv.websites.isabelle.aten_production;
   app = pkgs.webapps.aten.override { environment = secrets.environment; };
-  cfg = config.myServices.websites.aten.production;
+  cfg = config.myServices.websites.isabelle.aten_production;
   pcfg = config.services.phpApplication;
 in {
-  options.myServices.websites.aten.production.enable = lib.mkEnableOption "enable Aten's website in production";
+  options.myServices.websites.isabelle.aten_production.enable = lib.mkEnableOption "enable Aten's website in production";
 
   config = lib.mkIf cfg.enable {
     services.duplyBackup.profiles.aten_prod.rootDir = app.varDir;
diff --git a/modules/private/websites/isabelle/iridologie.nix b/modules/private/websites/isabelle/iridologie.nix
new file mode 100644 (file)
index 0000000..88f8b03
--- /dev/null
@@ -0,0 +1,31 @@
+{ lib, config,  ... }:
+let
+  cfg = config.myServices.websites.isabelle.iridologie;
+  varDir = "/var/lib/ftp/isabelle";
+in {
+  options.myServices.websites.isabelle.iridologie.enable = lib.mkEnableOption "enable Iridologie's website";
+
+  config = lib.mkIf cfg.enable {
+    services.webstats.sites = [ { name = "iridologie.icommandeur.org"; } ];
+    services.websites.env.production.vhostConfs.iridologie = {
+      certName    = "aten";
+      hosts       = [ "icommandeur.org" "www.icommandeur.org" "iridologie.icommandeur.org" ];
+      root        = varDir;
+      extraConfig = [
+        ''
+        Use Stats iridologie.icommandeur.org
+        RewriteEngine On
+        RewriteCond "%{HTTP_HOST}" "!^iridologie\.icommandeur\.org$" [NC]
+        RewriteRule ^(.+)$ https://iridologie.icommandeur.org$1 [R=302,L]
+
+        <Directory ${varDir}>
+          DirectoryIndex index.html
+          AllowOverride None
+          Require all granted
+        </Directory>
+          ''
+      ];
+    };
+  };
+}
+