From ecd8d42397d0142b9b54e1e0664acb43c146fe98 Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Thu, 5 May 2022 22:26:54 +0000 Subject: [PATCH 1/4] nextcloud24: init at 24.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Nextcloud 23 and set it as the default Nextcloud version for the NixOS module. Added PHP 8.1 as an option for phpPackage and default for Nextcloud ≥ 24. --- nixos/modules/services/web-apps/nextcloud.nix | 11 ++++++----- nixos/modules/services/web-apps/nextcloud.xml | 2 +- nixos/tests/nextcloud/default.nix | 2 +- pkgs/servers/nextcloud/default.nix | 6 ++++++ pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index a4b886821ebf..b44d8cbbba3f 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -153,11 +153,11 @@ in { package = mkOption { type = types.package; description = "Which package to use for the Nextcloud instance."; - relatedPackages = [ "nextcloud22" "nextcloud23" ]; + relatedPackages = [ "nextcloud22" "nextcloud23" "nextcloud24"]; }; phpPackage = mkOption { type = types.package; - relatedPackages = [ "php74" "php80" ]; + relatedPackages = [ "php74" "php80" "php81"]; defaultText = "pkgs.php"; description = '' PHP package to use for Nextcloud. @@ -555,7 +555,7 @@ in { config = mkIf cfg.enable (mkMerge [ { warnings = let - latest = 23; + latest = 24; upgradeWarning = major: nixos: '' A legacy Nextcloud install (from before NixOS ${nixos}) may be installed. @@ -613,14 +613,15 @@ in { '' else if versionOlder stateVersion "21.11" then nextcloud21 else if versionOlder stateVersion "22.05" then nextcloud22 - else nextcloud23 + else nextcloud24 ); services.nextcloud.datadir = mkOptionDefault config.services.nextcloud.home; services.nextcloud.phpPackage = if versionOlder cfg.package.version "21" then pkgs.php74 - else pkgs.php80; + else if versionOlder cfg.package.version "24" then pkgs.php80 + else pkgs.php81; } { assertions = [ diff --git a/nixos/modules/services/web-apps/nextcloud.xml b/nixos/modules/services/web-apps/nextcloud.xml index 8f55086a2bd1..b46f34420a70 100644 --- a/nixos/modules/services/web-apps/nextcloud.xml +++ b/nixos/modules/services/web-apps/nextcloud.xml @@ -11,7 +11,7 @@ desktop client is packaged at pkgs.nextcloud-client. - The current default by NixOS is nextcloud23 which is also the latest + The current default by NixOS is nextcloud24 which is also the latest major version available.
diff --git a/nixos/tests/nextcloud/default.nix b/nixos/tests/nextcloud/default.nix index b7b1c5c66002..76feac314d5b 100644 --- a/nixos/tests/nextcloud/default.nix +++ b/nixos/tests/nextcloud/default.nix @@ -18,4 +18,4 @@ foldl }; }) { } - [ 22 23 ] + [ 22 23 24 ] diff --git a/pkgs/servers/nextcloud/default.nix b/pkgs/servers/nextcloud/default.nix index e71fb9db115e..5b88481d1d29 100644 --- a/pkgs/servers/nextcloud/default.nix +++ b/pkgs/servers/nextcloud/default.nix @@ -54,6 +54,12 @@ in { version = "23.0.4"; sha256 = "67191c2b8b41591ae42accfb32216313fde0e107201682cb39029f890712bc6a"; }; + + nextcloud24 = generic { + version = "24.0.0"; + sha256 = "176cb5620f20465fb4759bdf3caaebeb7acff39d6c8630351af9f8738c173780"; + }; + # tip: get she sha with: # curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256' } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8172605a2102..2ec1dbc6a028 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8600,7 +8600,7 @@ with pkgs; grocy = callPackage ../servers/grocy { }; inherit (callPackage ../servers/nextcloud {}) - nextcloud21 nextcloud22 nextcloud23; + nextcloud21 nextcloud22 nextcloud23 nextcloud24; nextcloud-client = libsForQt5.callPackage ../applications/networking/nextcloud-client { }; From 6f80d6836ac46607c2058d928bd4464ea83ffcc8 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 18 May 2022 11:22:31 +0200 Subject: [PATCH 2/4] nixos/nextcloud: mariadb workaround is for versions >=24 not needed anymore --- nixos/modules/services/web-apps/nextcloud.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index b44d8cbbba3f..66d9b2647e6b 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -872,7 +872,7 @@ in { # FIXME(@Ma27) Nextcloud isn't compatible with mariadb 10.6, # this is a workaround. # See https://help.nextcloud.com/t/update-to-next-cloud-21-0-2-has-get-an-error/117028/22 - settings = { + settings = mkIf (versionOlder cfg.package.version "24") { mysqld = { innodb_read_only_compressed = 0; }; From e46bff95697e7a6d8345770c2b26fc542b29b676 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 18 May 2022 11:47:50 +0200 Subject: [PATCH 3/4] nixos/nextcloud: upgrade instructions / info for v23 --- nixos/modules/services/web-apps/nextcloud.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 66d9b2647e6b..d45c4eed0204 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -591,6 +591,7 @@ in { ++ (optional (versionOlder cfg.package.version "21") (upgradeWarning 20 "21.05")) ++ (optional (versionOlder cfg.package.version "22") (upgradeWarning 21 "21.11")) ++ (optional (versionOlder cfg.package.version "23") (upgradeWarning 22 "22.05")) + ++ (optional (versionOlder cfg.package.version "24") (upgradeWarning 23 "22.05")) ++ (optional isUnsupportedMariadb '' You seem to be using MariaDB at an unsupported version (i.e. at least 10.6)! Please note that this isn't supported officially by Nextcloud. You can either From a0bcf1e9ea964f07128c99d39daa486b0cfca00d Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 18 May 2022 11:50:53 +0200 Subject: [PATCH 4/4] nixos/nextcloud: styling --- nixos/modules/services/web-apps/nextcloud.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index d45c4eed0204..940aa9b220be 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -153,11 +153,11 @@ in { package = mkOption { type = types.package; description = "Which package to use for the Nextcloud instance."; - relatedPackages = [ "nextcloud22" "nextcloud23" "nextcloud24"]; + relatedPackages = [ "nextcloud22" "nextcloud23" "nextcloud24" ]; }; phpPackage = mkOption { type = types.package; - relatedPackages = [ "php74" "php80" "php81"]; + relatedPackages = [ "php74" "php80" "php81" ]; defaultText = "pkgs.php"; description = '' PHP package to use for Nextcloud.