nixpkgs/pkgs/servers/nextcloud/default.nix
Maximilian Bosch e1e15974f8
nextcloud20: drop
The version 20 of Nextcloud will be EOLed by the end of this month[1].

Since the recommended default (that didn't raise an eval-warning) on
21.05 was Nextcloud 21, this shouldn't affect too many people.

In order to ensure that nobody does a (not working) upgrade across
several major-versions of Nextcloud, I replaced the derivation of
`nextcloud20` with a `throw` that provides instructions how to proceed.

The only case that I consider "risky" is a setup upgraded from 21.05 (or
older) with a `system.stateVersion` <21.11 and with
`services.nextcloud.package` not explicitly declared in its config. To
avoid that, I also left the `else-if` for `stateVersion < 21.03` which
now sets `services.nextcloud.package` to `pkgs.nextcloud20` and thus
leads to an eval-error. This condition can be removed
as soon as 21.05 is EOL because then it's safe to assume that only
21.11. is used as stable release where no Nextcloud <=20 exists that can
lead to such an issue.

It can't be removed earlier because then every `system.stateVersion <
21.11` would lead to `nextcloud21` which is a problem if `nextcloud19`
is still used.

[1] https://docs.nextcloud.com/server/20/admin_manual/release_schedule.html
2021-10-25 01:34:47 +02:00

60 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, nixosTests }:
let
generic = {
version, sha256,
eol ? false, extraVulnerabilities ? []
}: stdenv.mkDerivation rec {
pname = "nextcloud";
inherit version;
src = fetchurl {
url = "https://download.nextcloud.com/server/releases/${pname}-${version}.tar.bz2";
inherit sha256;
};
passthru.tests = nixosTests.nextcloud;
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
runHook postInstall
'';
meta = with lib; {
description = "Sharing solution for files, calendars, contacts and more";
homepage = "https://nextcloud.com";
maintainers = with maintainers; [ schneefux bachp globin fpletz ma27 ];
license = licenses.agpl3Plus;
platforms = with platforms; unix;
knownVulnerabilities = extraVulnerabilities
++ (optional eol "Nextcloud version ${version} is EOL");
};
};
in {
nextcloud20 = throw ''
Nextcloud v20 has been removed from `nixpkgs` as the support for it was dropped
by upstream in 2021-10. Please upgrade to at least Nextcloud v21 by declaring
services.nextcloud.package = pkgs.nextcloud21;
in your NixOS config.
WARNING: if you were on Nextcloud 19 on NixOS 21.05 you have to upgrade to Nextcloud 20
first on 21.05 because Nextcloud doesn't support upgrades accross multiple major versions!
'';
nextcloud21 = generic {
version = "21.0.5";
sha256 = "1q46h480kn97k7h3xm7r5gsa8l3f0kfiicapi46sh0p39pbjbyhv";
};
nextcloud22 = generic {
version = "22.2.0";
sha256 = "07ryvynws65k42n6ca20nni1vqr90fsrd2dpx2bvh09mwhyblg97";
};
# tip: get she sha with:
# curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
}