Merge pull request #140159 from Ma27/nextcloud-misc

nextcloud: misc changes

authored by

Maximilian Bosch and committed by
GitHub
cdb48d75 6d898617

+45 -12
+13 -1
nixos/modules/services/web-apps/nextcloud.nix
··· 6 6 cfg = config.services.nextcloud; 7 7 fpm = config.services.phpfpm.pools.nextcloud; 8 8 9 - phpPackage = pkgs.php74.buildEnv { 9 + phpPackage = cfg.phpPackage.buildEnv { 10 10 extensions = { enabled, all }: 11 11 (with all; 12 12 enabled ··· 93 93 type = types.package; 94 94 description = "Which package to use for the Nextcloud instance."; 95 95 relatedPackages = [ "nextcloud20" "nextcloud21" "nextcloud22" ]; 96 + }; 97 + phpPackage = mkOption { 98 + type = types.package; 99 + relatedPackages = [ "php74" "php80" ]; 100 + defaultText = "pkgs.php"; 101 + description = '' 102 + PHP package to use for Nextcloud. 103 + ''; 96 104 }; 97 105 98 106 maxUploadSize = mkOption { ··· 449 457 else if versionOlder stateVersion "21.11" then nextcloud21 450 458 else nextcloud22 451 459 ); 460 + 461 + services.nextcloud.phpPackage = 462 + if versionOlder cfg.package.version "21" then pkgs.php74 463 + else pkgs.php80; 452 464 } 453 465 454 466 { systemd.timers.nextcloud-cron = {
+5 -2
nixos/tests/nextcloud/basic.nix
··· 1 - import ../make-test-python.nix ({ pkgs, ...}: let 1 + args@{ pkgs, nextcloudVersion ? 22, ... }: 2 + 3 + (import ../make-test-python.nix ({ pkgs, ...}: let 2 4 adminpass = "notproduction"; 3 5 adminuser = "root"; 4 6 in { ··· 39 41 inherit adminpass; 40 42 dbtableprefix = "nixos_"; 41 43 }; 44 + package = pkgs.${"nextcloud" + (toString nextcloudVersion)}; 42 45 autoUpdateApps = { 43 46 enable = true; 44 47 startAt = "20:00"; ··· 100 103 ) 101 104 assert "hi" in client.succeed("cat /mnt/dav/test-shared-file") 102 105 ''; 103 - }) 106 + })) args
+17 -5
nixos/tests/nextcloud/default.nix
··· 2 2 config ? {}, 3 3 pkgs ? import ../../.. { inherit system config; } 4 4 }: 5 - { 6 - basic = import ./basic.nix { inherit system pkgs; }; 7 - with-postgresql-and-redis = import ./with-postgresql-and-redis.nix { inherit system pkgs; }; 8 - with-mysql-and-memcached = import ./with-mysql-and-memcached.nix { inherit system pkgs; }; 9 - } 5 + 6 + with pkgs.lib; 7 + 8 + foldl 9 + (matrix: ver: matrix // { 10 + "basic${toString ver}" = import ./basic.nix { inherit system pkgs; nextcloudVersion = ver; }; 11 + "with-postgresql-and-redis${toString ver}" = import ./with-postgresql-and-redis.nix { 12 + inherit system pkgs; 13 + nextcloudVersion = ver; 14 + }; 15 + "with-mysql-and-memcached${toString ver}" = import ./with-mysql-and-memcached.nix { 16 + inherit system pkgs; 17 + nextcloudVersion = ver; 18 + }; 19 + }) 20 + {} 21 + [ 20 21 22 ]
+5 -2
nixos/tests/nextcloud/with-mysql-and-memcached.nix
··· 1 - import ../make-test-python.nix ({ pkgs, ...}: let 1 + args@{ pkgs, nextcloudVersion ? 22, ... }: 2 + 3 + (import ../make-test-python.nix ({ pkgs, ...}: let 2 4 adminpass = "hunter2"; 3 5 adminuser = "root"; 4 6 in { ··· 18 20 enable = true; 19 21 hostName = "nextcloud"; 20 22 https = true; 23 + package = pkgs.${"nextcloud" + (toString nextcloudVersion)}; 21 24 caching = { 22 25 apcu = true; 23 26 redis = false; ··· 103 106 "${withRcloneEnv} ${diffSharedFile}" 104 107 ) 105 108 ''; 106 - }) 109 + })) args
+5 -2
nixos/tests/nextcloud/with-postgresql-and-redis.nix
··· 1 - import ../make-test-python.nix ({ pkgs, ...}: let 1 + args@{ pkgs, nextcloudVersion ? 22, ... }: 2 + 3 + (import ../make-test-python.nix ({ pkgs, ...}: let 2 4 adminpass = "hunter2"; 3 5 adminuser = "custom-admin-username"; 4 6 in { ··· 17 19 services.nextcloud = { 18 20 enable = true; 19 21 hostName = "nextcloud"; 22 + package = pkgs.${"nextcloud" + (toString nextcloudVersion)}; 20 23 caching = { 21 24 apcu = false; 22 25 redis = true; ··· 96 99 "${withRcloneEnv} ${diffSharedFile}" 97 100 ) 98 101 ''; 99 - }) 102 + })) args