2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2020-12-25 13:55:36 +00:00
|
|
|
generic = {
|
2023-02-02 18:25:31 +00:00
|
|
|
version, hash,
|
2020-12-25 13:55:36 +00:00
|
|
|
eol ? false, extraVulnerabilities ? []
|
2022-12-17 10:02:37 +00:00
|
|
|
}: let
|
|
|
|
major = lib.versions.major version;
|
2023-02-02 18:25:31 +00:00
|
|
|
prerelease = builtins.length (lib.versions.splitVersion version) > 3;
|
2022-12-17 10:02:37 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "nextcloud";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
2023-02-02 18:25:31 +00:00
|
|
|
url = "https://download.nextcloud.com/server/${if prerelease then "prereleases" else "release"}/${pname}-${version}.tar.bz2";
|
|
|
|
inherit hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [ (./patches + "/v${major}/0001-Setup-remove-custom-dbuser-creation-behavior.patch") ];
|
2022-09-11 15:47:08 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru.tests = nixosTests.nextcloud;
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-05-28 09:39:13 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/
|
|
|
|
cp -R . $out/
|
2021-05-28 09:39:13 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Sharing solution for files, calendars, contacts and more";
|
|
|
|
homepage = "https://nextcloud.com";
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ schneefux bachp globin ma27 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = with platforms; unix;
|
2020-12-25 13:55:36 +00:00
|
|
|
knownVulnerabilities = extraVulnerabilities
|
|
|
|
++ (optional eol "Nextcloud version ${version} is EOL");
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
2022-10-30 15:09:59 +00:00
|
|
|
nextcloud23 = throw ''
|
|
|
|
Nextcloud v23 has been removed from `nixpkgs` as the support for is dropped
|
|
|
|
by upstream in 2022-12. Please upgrade to at least Nextcloud v24 by declaring
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
services.nextcloud.package = pkgs.nextcloud24;
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
in your NixOS config.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
WARNING: if you were on Nextcloud 22 on NixOS 22.05 you have to upgrade to Nextcloud 23
|
2022-12-28 21:21:41 +00:00
|
|
|
first on 22.05 because Nextcloud doesn't support upgrades across multiple major versions!
|
2021-10-28 06:52:43 +00:00
|
|
|
'';
|
2021-03-09 03:18:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
nextcloud24 = generic {
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "24.0.9";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-WAozhMnAmu+46bQVU9IabiAAF5lUnb0lsx3qIR2X3R4=";
|
2022-05-18 14:49:53 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nextcloud25 = generic {
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "25.0.3";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-SysUI3Nu+SRpCW/iT2HCTK2Ho04HwceoGzhdPqJcAOw=";
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nextcloud26 = generic {
|
|
|
|
version = "26.0.0beta1";
|
|
|
|
hash = "sha256-EfSfn0KjQzciHa3VcrDhGC/aZUw/KDjihXs+qVIcYX0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# tip: get hash with:
|
|
|
|
# nix hash to-sri --type sha256 $(curl https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256 | cut -d' ' -f1)
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|