]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/cloud/default.nix
Upgrade nextcloud to 18
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / cloud / default.nix
index 3b6a8718b29713ad32e0ee60ac938e1cc189db9f..e6f8ecb8a1b0e296f38192d919d24fb3280cb06f 100644 (file)
@@ -79,8 +79,10 @@ in {
       user = "wwwrun";
       group = "wwwrun";
       permissions = "0600";
+      # This file is not actually included, see activationScript below
       text = ''
         <?php
+        include('${nextcloud}/version.php');
         $CONFIG = array (
           // FIXME: change this value when nextcloud starts getting slow
           'instanceid' => '${env.instance_id}1',
@@ -88,7 +90,7 @@ in {
           'passwordsalt' => '${env.password_salt}',
           'debug' => false,
           'dbtype' => 'pgsql',
-          'version' => '16.0.0.9',
+          'version' => implode($OC_Version, '.'),
           'dbname' => '${env.postgresql.database}',
           'dbhost' => '${env.postgresql.socket}',
           'dbtableprefix' => 'oc_',
@@ -139,8 +141,8 @@ in {
         cd ${nextcloud}
         NEXTCLOUD_CONFIG_DIR="${nextcloud}/config" \
           exec \
-          sudo -u wwwrun ${pkgs.php73}/bin/php \
-          -c ${pkgs.php73}/etc/php.ini \
+          sudo -u wwwrun ${pkgs.php74}/bin/php \
+          -c ${pkgs.php74}/etc/php.ini \
           occ $*
         '';
     in [ occ ];
@@ -156,7 +158,7 @@ in {
         ${builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v:
           "install -D -m 0644 -o wwwrun -g wwwrun -T ${v} ${varDir}/config/${n}.json"
           ) confs)}
-        install -D -m 0600 -o wwwrun -g wwwrun -T /var/secrets/webapps/tools-nextcloud ${varDir}/config/config.php
+        #install -D -m 0600 -o wwwrun -g wwwrun -T /var/secrets/webapps/tools-nextcloud ${varDir}/config/config.php
       '';
     };
     # FIXME: add a warning when config.php changes
@@ -169,7 +171,7 @@ in {
       user = "wwwrun";
       group = "wwwrun";
       settings = phpFpm.pool;
-      phpPackage = pkgs.php73.withExtensions(e: pkgs.php73.enabledExtensions ++ [ e.redis e.apcu e.opcache ]);
+      phpPackage = pkgs.php74.withExtensions(e: pkgs.php74.enabledExtensions ++ [ e.redis e.apcu e.opcache ]);
     };
 
     services.cron = {
@@ -179,7 +181,7 @@ in {
           #! ${pkgs.stdenv.shell}
           export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
           export PATH=/run/wrappers/bin:$PATH
-          ${pkgs.php73}/bin/php -d memory_limit=512M -f ${nextcloud}/cron.php
+          ${pkgs.php74}/bin/php -d memory_limit=512M -f ${nextcloud}/cron.php
           '';
       in [
         ''