lol
1{ lib, stdenv, fetchurl, nixosTests }:
2
3let
4 generic = {
5 version, sha256,
6 eol ? false, extraVulnerabilities ? []
7 }: stdenv.mkDerivation rec {
8 pname = "nextcloud";
9 inherit version;
10
11 src = fetchurl {
12 url = "https://download.nextcloud.com/server/releases/${pname}-${version}.tar.bz2";
13 inherit sha256;
14 };
15
16 patches = [ ./0001-Setup-remove-custom-dbuser-creation-behavior.patch ];
17
18 passthru.tests = nixosTests.nextcloud;
19
20 installPhase = ''
21 runHook preInstall
22 mkdir -p $out/
23 cp -R . $out/
24 runHook postInstall
25 '';
26
27 meta = with lib; {
28 description = "Sharing solution for files, calendars, contacts and more";
29 homepage = "https://nextcloud.com";
30 maintainers = with maintainers; [ schneefux bachp globin ma27 ];
31 license = licenses.agpl3Plus;
32 platforms = with platforms; unix;
33 knownVulnerabilities = extraVulnerabilities
34 ++ (optional eol "Nextcloud version ${version} is EOL");
35 };
36 };
37in {
38 nextcloud23 = throw ''
39 Nextcloud v23 has been removed from `nixpkgs` as the support for is dropped
40 by upstream in 2022-12. Please upgrade to at least Nextcloud v24 by declaring
41
42 services.nextcloud.package = pkgs.nextcloud24;
43
44 in your NixOS config.
45
46 WARNING: if you were on Nextcloud 22 on NixOS 22.05 you have to upgrade to Nextcloud 23
47 first on 22.05 because Nextcloud doesn't support upgrades accross multiple major versions!
48 '';
49
50 nextcloud24 = generic {
51 version = "24.0.7";
52 sha256 = "a1c7344a4eb27260a9f6f6e6f586bdc4fb35e1e9330e1a6e8d46c05634db6384";
53 };
54
55 nextcloud25 = generic {
56 version = "25.0.1";
57 sha256 = "72d4076924caf19139c40178597af6211799e20440ce196fb43b9c4e47d77515";
58 };
59
60 # tip: get the sha with:
61 # curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
62}