2023-06-16 14:46:29 +00:00
|
|
|
{ lib, stdenv, fetchurl, nixosTests
|
|
|
|
, nextcloud27Packages
|
|
|
|
, nextcloud26Packages
|
|
|
|
, nextcloud25Packages
|
|
|
|
}:
|
2016-09-21 15:55:38 +00:00
|
|
|
|
2020-03-14 03:07:30 +00:00
|
|
|
let
|
2020-12-10 19:57:42 +00:00
|
|
|
generic = {
|
2023-06-16 14:46:29 +00:00
|
|
|
version, sha256
|
|
|
|
, eol ? false, extraVulnerabilities ? []
|
|
|
|
, packages
|
2022-12-09 11:34:23 +00:00
|
|
|
}: let
|
|
|
|
major = lib.versions.major version;
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-03-14 03:07:30 +00:00
|
|
|
pname = "nextcloud";
|
|
|
|
inherit version;
|
2016-09-21 15:55:38 +00:00
|
|
|
|
2020-03-14 03:07:30 +00:00
|
|
|
src = fetchurl {
|
2023-01-28 21:01:42 +00:00
|
|
|
url = "https://download.nextcloud.com/server/releases/${pname}-${version}.tar.bz2";
|
|
|
|
inherit sha256;
|
2020-03-14 03:07:30 +00:00
|
|
|
};
|
|
|
|
|
2023-03-21 16:34:23 +00:00
|
|
|
# This patch is only necessary for NC version <26.
|
|
|
|
patches = lib.optional (lib.versionOlder major "26") (./patches + "/v${major}/0001-Setup-remove-custom-dbuser-creation-behavior.patch");
|
2022-09-10 13:23:39 +00:00
|
|
|
|
2023-06-16 14:46:29 +00:00
|
|
|
passthru = {
|
|
|
|
tests = nixosTests.nextcloud;
|
|
|
|
inherit packages;
|
|
|
|
};
|
2020-04-15 20:14:04 +00:00
|
|
|
|
2020-03-14 03:07:30 +00:00
|
|
|
installPhase = ''
|
2021-05-21 08:31:38 +00:00
|
|
|
runHook preInstall
|
2020-03-14 03:07:30 +00:00
|
|
|
mkdir -p $out/
|
|
|
|
cp -R . $out/
|
2021-05-21 08:31:38 +00:00
|
|
|
runHook postInstall
|
2020-03-14 03:07:30 +00:00
|
|
|
'';
|
2016-09-21 15:55:38 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-02-23 16:57:40 +00:00
|
|
|
changelog = "https://nextcloud.com/changelog/#${lib.replaceStrings [ "." ] [ "-" ] version}";
|
2020-03-14 03:07:30 +00:00
|
|
|
description = "Sharing solution for files, calendars, contacts and more";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://nextcloud.com";
|
2022-08-03 12:13:56 +00:00
|
|
|
maintainers = with maintainers; [ schneefux bachp globin ma27 ];
|
2020-03-14 03:07:30 +00:00
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = with platforms; unix;
|
2020-12-10 19:57:42 +00:00
|
|
|
knownVulnerabilities = extraVulnerabilities
|
|
|
|
++ (optional eol "Nextcloud version ${version} is EOL");
|
2020-03-14 03:07:30 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
2023-04-20 09:34:54 +00:00
|
|
|
nextcloud24 = throw ''
|
|
|
|
Nextcloud v24 has been removed from `nixpkgs` as the support for is dropped
|
|
|
|
by upstream in 2023-04. Please upgrade to at least Nextcloud v25 by declaring
|
|
|
|
|
|
|
|
services.nextcloud.package = pkgs.nextcloud25;
|
|
|
|
|
|
|
|
in your NixOS config.
|
|
|
|
|
|
|
|
WARNING: if you were on Nextcloud 23 you have to upgrade to Nextcloud 24
|
|
|
|
first on 22.11 because Nextcloud doesn't support upgrades across multiple major versions!
|
|
|
|
'';
|
2022-05-05 22:26:54 +00:00
|
|
|
|
2022-10-23 14:31:22 +00:00
|
|
|
nextcloud25 = generic {
|
2023-07-20 19:13:06 +00:00
|
|
|
version = "25.0.9";
|
|
|
|
sha256 = "sha256-k5XVM0ABRtAiCNoPNvkpYxq16Nb9Xd/VXNpqIDWg/nA=";
|
2023-06-16 14:46:29 +00:00
|
|
|
packages = nextcloud25Packages;
|
2022-10-23 14:31:22 +00:00
|
|
|
};
|
|
|
|
|
2023-03-21 15:41:47 +00:00
|
|
|
nextcloud26 = generic {
|
2023-07-20 19:20:15 +00:00
|
|
|
version = "26.0.4";
|
|
|
|
sha256 = "sha256-gBya6RLPYmS+csFB5BjT2H1OZxx6ndZDAI9dfWmR6i4=";
|
2023-06-16 14:46:29 +00:00
|
|
|
packages = nextcloud26Packages;
|
2023-03-21 15:41:47 +00:00
|
|
|
};
|
|
|
|
|
2023-06-14 11:59:43 +00:00
|
|
|
nextcloud27 = generic {
|
2023-07-20 19:22:48 +00:00
|
|
|
version = "27.0.1";
|
|
|
|
sha256 = "sha256-OXa16PWPk03b63zEmsM7Ea0629f21dCQig/DahYMJ70=";
|
2023-06-16 14:46:29 +00:00
|
|
|
packages = nextcloud27Packages;
|
2023-06-14 11:59:43 +00:00
|
|
|
};
|
|
|
|
|
2023-01-28 21:01:42 +00:00
|
|
|
# tip: get the sha with:
|
|
|
|
# curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
|
2016-09-21 15:55:38 +00:00
|
|
|
}
|