Merge pull request #140159 from Ma27/nextcloud-misc
nextcloud: misc changes
This commit is contained in:
commit
cdb48d75c0
5 changed files with 45 additions and 12 deletions
|
@ -6,7 +6,7 @@ let
|
|||
cfg = config.services.nextcloud;
|
||||
fpm = config.services.phpfpm.pools.nextcloud;
|
||||
|
||||
phpPackage = pkgs.php74.buildEnv {
|
||||
phpPackage = cfg.phpPackage.buildEnv {
|
||||
extensions = { enabled, all }:
|
||||
(with all;
|
||||
enabled
|
||||
|
@ -94,6 +94,14 @@ in {
|
|||
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 {
|
||||
default = "512M";
|
||||
|
@ -449,6 +457,10 @@ in {
|
|||
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 = {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import ../make-test-python.nix ({ pkgs, ...}: let
|
||||
args@{ pkgs, nextcloudVersion ? 22, ... }:
|
||||
|
||||
(import ../make-test-python.nix ({ pkgs, ...}: let
|
||||
adminpass = "notproduction";
|
||||
adminuser = "root";
|
||||
in {
|
||||
|
@ -39,6 +41,7 @@ in {
|
|||
inherit adminpass;
|
||||
dbtableprefix = "nixos_";
|
||||
};
|
||||
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
|
||||
autoUpdateApps = {
|
||||
enable = true;
|
||||
startAt = "20:00";
|
||||
|
@ -100,4 +103,4 @@ in {
|
|||
)
|
||||
assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
|
||||
'';
|
||||
})
|
||||
})) args
|
||||
|
|
|
@ -2,8 +2,20 @@
|
|||
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 ]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import ../make-test-python.nix ({ pkgs, ...}: let
|
||||
args@{ pkgs, nextcloudVersion ? 22, ... }:
|
||||
|
||||
(import ../make-test-python.nix ({ pkgs, ...}: let
|
||||
adminpass = "hunter2";
|
||||
adminuser = "root";
|
||||
in {
|
||||
|
@ -18,6 +20,7 @@ in {
|
|||
enable = true;
|
||||
hostName = "nextcloud";
|
||||
https = true;
|
||||
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
|
||||
caching = {
|
||||
apcu = true;
|
||||
redis = false;
|
||||
|
@ -103,4 +106,4 @@ in {
|
|||
"${withRcloneEnv} ${diffSharedFile}"
|
||||
)
|
||||
'';
|
||||
})
|
||||
})) args
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
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 {
|
||||
|
@ -17,6 +19,7 @@ in {
|
|||
services.nextcloud = {
|
||||
enable = true;
|
||||
hostName = "nextcloud";
|
||||
package = pkgs.${"nextcloud" + (toString nextcloudVersion)};
|
||||
caching = {
|
||||
apcu = false;
|
||||
redis = true;
|
||||
|
@ -96,4 +99,4 @@ in {
|
|||
"${withRcloneEnv} ${diffSharedFile}"
|
||||
)
|
||||
'';
|
||||
})
|
||||
})) args
|
||||
|
|
Loading…
Reference in a new issue