]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/nicecoop/gestion-compte_integration.nix
Migrate php sessions to redis
[perso/Immae/Config/Nix.git] / modules / private / websites / nicecoop / gestion-compte_integration.nix
index bdc2d1a98169cc4ef672ff56b2d69f4890bb6f35..47f4dc714fe5c9950b930203340490666208b2e8 100644 (file)
@@ -26,13 +26,15 @@ in {
         ];
         "php_admin_value[upload_max_filesize]" = "20M";
         "php_admin_value[post_max_size]" = "20M";
-        "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
+        "php_admin_value[session.save_handler]" = "redis";
+        "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Nicecoop:GestionCompteIntegration:'";
         "pm" = "dynamic";
         "pm.max_children" = "20";
         "pm.start_servers" = "2";
         "pm.min_spare_servers" = "1";
         "pm.max_spare_servers" = "3";
       };
+      phpPackage = pkgs.php74.withExtensions({ enabled, all }: enabled ++ [all.redis]);
     };
     services.cron = {
       systemCronJobs = let
@@ -99,7 +101,7 @@ in {
     system.activationScripts.nicecoop_gestion-compte_integration = {
       deps = [];
       text = ''
-        install -m 0700 -o wwwrun -g wwwrun -d ${varDir} ${varDir}/phpSessions ${varDir}/var
+        install -m 0700 -o wwwrun -g wwwrun -d ${varDir} ${varDir}/var
       '';
     };