Merge pull request #140159 from Ma27/nextcloud-misc

nextcloud: misc changes

Changed files
+45 -12
nixos
+13 -1
nixos/modules/services/web-apps/nextcloud.nix
···
cfg = config.services.nextcloud;
fpm = config.services.phpfpm.pools.nextcloud;
-
phpPackage = pkgs.php74.buildEnv {
+
phpPackage = cfg.phpPackage.buildEnv {
extensions = { enabled, all }:
(with all;
enabled
···
type = types.package;
description = "Which package to use for the Nextcloud instance.";
relatedPackages = [ "nextcloud20" "nextcloud21" "nextcloud22" ];
+
};
+
phpPackage = mkOption {
+
type = types.package;
+
relatedPackages = [ "php74" "php80" ];
+
defaultText = "pkgs.php";
+
description = ''
+
PHP package to use for Nextcloud.
+
'';
};
maxUploadSize = mkOption {
···
else if versionOlder stateVersion "21.11" then nextcloud21
else nextcloud22
);
+
+
services.nextcloud.phpPackage =
+
if versionOlder cfg.package.version "21" then pkgs.php74
+
else pkgs.php80;
}
{ systemd.timers.nextcloud-cron = {
+5 -2
nixos/tests/nextcloud/basic.nix
···
-
import ../make-test-python.nix ({ pkgs, ...}: let
+
args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+
(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "notproduction";
adminuser = "root";
in {
···
inherit adminpass;
dbtableprefix = "nixos_";
};
+
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
autoUpdateApps = {
enable = true;
startAt = "20:00";
···
)
assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
'';
-
})
+
})) args
+17 -5
nixos/tests/nextcloud/default.nix
···
config ? {},
pkgs ? import ../../.. { inherit system config; }
}:
-
{
-
basic = import ./basic.nix { inherit system pkgs; };
-
with-postgresql-and-redis = import ./with-postgresql-and-redis.nix { inherit system pkgs; };
-
with-mysql-and-memcached = import ./with-mysql-and-memcached.nix { inherit system pkgs; };
-
}
+
+
with pkgs.lib;
+
+
foldl
+
(matrix: ver: matrix // {
+
"basic${toString ver}" = import ./basic.nix { inherit system pkgs; nextcloudVersion = ver; };
+
"with-postgresql-and-redis${toString ver}" = import ./with-postgresql-and-redis.nix {
+
inherit system pkgs;
+
nextcloudVersion = ver;
+
};
+
"with-mysql-and-memcached${toString ver}" = import ./with-mysql-and-memcached.nix {
+
inherit system pkgs;
+
nextcloudVersion = ver;
+
};
+
})
+
{}
+
[ 20 21 22 ]
+5 -2
nixos/tests/nextcloud/with-mysql-and-memcached.nix
···
-
import ../make-test-python.nix ({ pkgs, ...}: let
+
args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+
(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "root";
in {
···
enable = true;
hostName = "nextcloud";
https = true;
+
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
caching = {
apcu = true;
redis = false;
···
"${withRcloneEnv} ${diffSharedFile}"
)
'';
-
})
+
})) args
+5 -2
nixos/tests/nextcloud/with-postgresql-and-redis.nix
···
-
import ../make-test-python.nix ({ pkgs, ...}: let
+
args@{ pkgs, nextcloudVersion ? 22, ... }:
+
+
(import ../make-test-python.nix ({ pkgs, ...}: let
adminpass = "hunter2";
adminuser = "custom-admin-username";
in {
···
services.nextcloud = {
enable = true;
hostName = "nextcloud";
+
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
caching = {
apcu = false;
redis = true;
···
"${withRcloneEnv} ${diffSharedFile}"
)
'';
-
})
+
})) args