X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Ftools%2Fcloud%2Fdefault.nix;h=8a42cad9117924664764568eb7882cf66dd3a7bc;hb=abd7458cbc97f9074f851f07f1f9145344b981ff;hp=0c6bf0d5ee55dd60c68a3a0137845700c1fd1871;hpb=f5761aac8dbfb4af91c232f2b52d1353c899abda;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/cloud/default.nix b/modules/private/websites/tools/cloud/default.nix index 0c6bf0d..8a42cad 100644 --- a/modules/private/websites/tools/cloud/default.nix +++ b/modules/private/websites/tools/cloud/default.nix @@ -1,15 +1,18 @@ { lib, pkgs, config, ... }: let - nextcloud = pkgs.webapps.nextcloud.withApps (builtins.attrValues pkgs.webapps.nextcloud-apps); + nextcloud = pkgs.webapps.nextcloud.withApps (a: [ + a.apporder a.audioplayer a.bookmarks a.calendar a.carnet a.contacts + a.cookbook a.deck a.extract a.files_markdown a.files_readmemd + a.flowupload a.gpxedit a.gpxpod a.keeweb a.maps a.metadata a.music + a.notes a.ocsms a.passman a.polls a.spreed a.tasks + ]); env = config.myEnv.tools.nextcloud; varDir = "/var/lib/nextcloud"; webappName = "tools_nextcloud"; apacheRoot = "/run/current-system/webapps/${webappName}"; cfg = config.myServices.websites.tools.cloud; phpFpm = rec { - basedir = builtins.concatStringsSep ":" ( - [ nextcloud varDir ] - ++ builtins.attrValues pkgs.webapps.nextcloud-apps); + basedir = builtins.concatStringsSep ":" ([ nextcloud varDir ] ++ nextcloud.apps); pool = { "listen.owner" = "wwwrun"; "listen.group" = "wwwrun"; @@ -33,7 +36,6 @@ let "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:${basedir}:/proc/meminfo:/dev/urandom:/proc/self/fd:/tmp"; "php_admin_value[session.save_path]" = "${varDir}/phpSessions"; }; - phpPackage = pkgs.php72.withExtensions(e: pkgs.php72.enabledExtensions ++ [ e.redis e.apcu e.opcache ]); }; in { options.myServices.websites.tools.cloud = { @@ -41,7 +43,6 @@ in { }; config = lib.mkIf cfg.enable { - # FIXME: find a way to backup the data services.websites.env.tools.modules = [ "proxy_fcgi" ]; services.websites.env.tools.vhostConfs.cloud = { @@ -77,16 +78,18 @@ in { user = "wwwrun"; group = "wwwrun"; permissions = "0600"; + # This file is not actually included, see activationScript below text = '' '${env.instance_id}1', + 'instanceid' => '${env.instance_id}', 'datadirectory' => '/var/lib/nextcloud/', '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_', @@ -137,8 +140,8 @@ in { cd ${nextcloud} NEXTCLOUD_CONFIG_DIR="${nextcloud}/config" \ exec \ - sudo -u wwwrun ${pkgs.php72}/bin/php \ - -c ${pkgs.php72}/etc/php.ini \ + sudo -E -u wwwrun ${pkgs.php74}/bin/php \ + -c ${pkgs.php74}/etc/php.ini \ occ $* ''; in [ occ ]; @@ -154,7 +157,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 @@ -167,7 +170,7 @@ in { user = "wwwrun"; group = "wwwrun"; settings = phpFpm.pool; - phpPackage = pkgs.php72.withExtensions(e: pkgs.php72.enabledExtensions ++ [ e.redis e.apcu e.opcache ]); + phpPackage = pkgs.php74.withExtensions({ enabled, all }: enabled ++ [ all.redis all.apcu all.opcache ]); }; services.cron = { @@ -177,7 +180,7 @@ in { #! ${pkgs.stdenv.shell} export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive export PATH=/run/wrappers/bin:$PATH - ${pkgs.php72}/bin/php -d memory_limit=512M -f ${nextcloud}/cron.php + ${pkgs.php74}/bin/php -d memory_limit=512M -f ${nextcloud}/cron.php ''; in [ ''