2025-07-10 17:02:24 +02:00

76 lines
1.8 KiB
Nix

{
lib,
stdenvNoCC,
fetchurl,
nixosTests,
cacert,
caBundle ? "${cacert}/etc/ssl/certs/ca-bundle.crt",
nextcloud30Packages,
nextcloud31Packages,
}:
let
generic =
{
version,
hash,
eol ? false,
extraVulnerabilities ? [ ],
packages,
}:
stdenvNoCC.mkDerivation rec {
pname = "nextcloud";
inherit version;
src = fetchurl {
url = "https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2";
inherit hash;
};
passthru = {
tests = lib.filterAttrs (
key: _: (lib.hasSuffix (lib.versions.major version) key)
) nixosTests.nextcloud;
inherit packages;
};
postPatch = ''
cp ${caBundle} resources/config/ca-bundle.crt
'';
installPhase = ''
runHook preInstall
mkdir -p $out/
cp -R . $out/
runHook postInstall
'';
meta = {
changelog = "https://nextcloud.com/changelog/#${lib.replaceStrings [ "." ] [ "-" ] version}";
description = "Sharing solution for files, calendars, contacts and more";
homepage = "https://nextcloud.com";
teams = [ lib.teams.nextcloud ];
license = lib.licenses.agpl3Plus;
platforms = lib.platforms.linux;
knownVulnerabilities =
extraVulnerabilities ++ (lib.optional eol "Nextcloud version ${version} is EOL");
};
};
in
{
nextcloud30 = generic {
version = "30.0.13";
hash = "sha256-viMmo689YHK08Uza05O5Y3qj3EDK9W/TgXXuo6j/j4Y=";
packages = nextcloud30Packages;
};
nextcloud31 = generic {
version = "31.0.7";
hash = "sha256-ACpdA64Fp/DDBWlH1toLeaRNPXIPVyj+UVWgxaO07Gk=";
packages = nextcloud31Packages;
};
# tip: get the sha with:
# curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
}