]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/chloe/production.nix
Use attrs for secrets instead of lists
[perso/Immae/Config/Nix.git] / modules / private / websites / chloe / production.nix
index 5cfc40cfef2cb38a0b30adbe0a5510faf9b62d70..92ae05be304f972ec1c932315c7e6581417d3ae7 100644 (file)
@@ -15,29 +15,27 @@ in {
 
   config = lib.mkIf cfg.enable {
     services.duplyBackup.profiles.chloe_production.rootDir = app.varDir;
-    secrets.keys = [
-      {
-        dest = "websites/chloe/production";
-        user = apacheUser;
-        group = apacheGroup;
-        permissions = "0400";
-        text = ''
-          SetEnv SPIP_CONFIG_DIR     "${./config}"
-          SetEnv SPIP_VAR_DIR        "${app.varDir}"
-          SetEnv SPIP_SITE           "chloe-${app.environment}"
-          SetEnv SPIP_LDAP_BASE      "dc=immae,dc=eu"
-          SetEnv SPIP_LDAP_HOST      "ldaps://ldap.immae.eu"
-          SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}"
-          SetEnv SPIP_LDAP_SEARCH_PW "${ccfg.ldap.password}"
-          SetEnv SPIP_LDAP_SEARCH    "${ccfg.ldap.filter}"
-          SetEnv SPIP_MYSQL_HOST     "${ccfg.mysql.host}"
-          SetEnv SPIP_MYSQL_PORT     "${ccfg.mysql.port}"
-          SetEnv SPIP_MYSQL_DB       "${ccfg.mysql.database}"
-          SetEnv SPIP_MYSQL_USER     "${ccfg.mysql.user}"
-          SetEnv SPIP_MYSQL_PASSWORD "${ccfg.mysql.password}"
-        '';
-      }
-    ];
+    services.duplyBackup.profiles.chloe_production.remotes = ["eriomem" "ovh"];
+    secrets.keys."websites/chloe/production" = {
+      user = apacheUser;
+      group = apacheGroup;
+      permissions = "0400";
+      text = ''
+        SetEnv SPIP_CONFIG_DIR     "${./config}"
+        SetEnv SPIP_VAR_DIR        "${app.varDir}"
+        SetEnv SPIP_SITE           "chloe-${app.environment}"
+        SetEnv SPIP_LDAP_BASE      "dc=immae,dc=eu"
+        SetEnv SPIP_LDAP_HOST      "ldaps://ldap.immae.eu"
+        SetEnv SPIP_LDAP_SEARCH_DN "${ccfg.ldap.dn}"
+        SetEnv SPIP_LDAP_SEARCH_PW "${ccfg.ldap.password}"
+        SetEnv SPIP_LDAP_SEARCH    "${ccfg.ldap.filter}"
+        SetEnv SPIP_MYSQL_HOST     "${ccfg.mysql.host}"
+        SetEnv SPIP_MYSQL_PORT     "${ccfg.mysql.port}"
+        SetEnv SPIP_MYSQL_DB       "${ccfg.mysql.database}"
+        SetEnv SPIP_MYSQL_USER     "${ccfg.mysql.user}"
+        SetEnv SPIP_MYSQL_PASSWORD "${ccfg.mysql.password}"
+      '';
+    };
     services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
 
     systemd.services.phpfpm-chloe_production.after = lib.mkAfter [ "mysql.service" ];
@@ -59,9 +57,6 @@ in {
         "pm.min_spare_servers" = "1";
         "pm.max_spare_servers" = "3";
       };
-      phpOptions = config.services.phpfpm.phpOptions + ''
-        extension=${pkgs.php72}/lib/php/extensions/mysqli.so
-      '';
       phpPackage = pkgs.php72;
     };
     system.activationScripts.chloe_production = {