nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 nixosTests,
6 nextcloud31Packages,
7 nextcloud32Packages,
8}:
9
10let
11 generic =
12 {
13 version,
14 hash,
15 eol ? false,
16 extraVulnerabilities ? [ ],
17 packages,
18 }:
19 stdenvNoCC.mkDerivation rec {
20 pname = "nextcloud";
21 inherit version;
22
23 src = fetchurl {
24 url = "https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2";
25 inherit hash;
26 };
27
28 passthru = {
29 tests = lib.filterAttrs (
30 key: _: (lib.hasSuffix (lib.versions.major version) key)
31 ) nixosTests.nextcloud;
32 inherit packages;
33 };
34
35 installPhase = ''
36 runHook preInstall
37 mkdir -p $out/
38 cp -R . $out/
39 runHook postInstall
40 '';
41
42 meta = {
43 changelog = "https://nextcloud.com/changelog/#${lib.replaceStrings [ "." ] [ "-" ] version}";
44 description = "Sharing solution for files, calendars, contacts and more";
45 homepage = "https://nextcloud.com";
46 teams = [ lib.teams.nextcloud ];
47 license = lib.licenses.agpl3Plus;
48 platforms = lib.platforms.linux;
49 knownVulnerabilities =
50 extraVulnerabilities ++ (lib.optional eol "Nextcloud version ${version} is EOL");
51 };
52 };
53in
54{
55 nextcloud31 = generic {
56 version = "31.0.13";
57 hash = "sha256-kt8INpRn6Bwj1/2Zevt1bq5Ezkfv8MhcXU0nIS6+KD4=";
58 packages = nextcloud31Packages;
59 };
60
61 nextcloud32 = generic {
62 version = "32.0.5";
63 hash = "sha256-jdC8j44tJi7a0RGX1KB695m1H+hy7i2SWf+hm0PlQ60=";
64 packages = nextcloud32Packages;
65 };
66
67 # tip: get the sha with:
68 # curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256'
69}