diff --git a/pkgs/servers/nextcloud/default.nix b/pkgs/servers/nextcloud/default.nix index a4e6a58cf3154..a7d2446541293 100644 --- a/pkgs/servers/nextcloud/default.nix +++ b/pkgs/servers/nextcloud/default.nix @@ -1,11 +1,13 @@ { lib, - stdenvNoCC, - fetchurl, + stdenv, + fetchFromGitHub, + fetchNpmDeps, nixosTests, nextcloud28Packages, nextcloud29Packages, nextcloud30Packages, + nodejs, }: let @@ -13,17 +15,29 @@ let { version, hash, + npmHash, eol ? false, extraVulnerabilities ? [ ], packages, }: - stdenvNoCC.mkDerivation rec { + stdenv.mkDerivation (finalAttrs: { pname = "nextcloud"; inherit version; - src = fetchurl { - url = "https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2"; + src = fetchFromGitHub { + owner = "nextcloud"; + repo = "server"; + rev = "refs/tags/v${version}"; inherit hash; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ nodejs ]; + + npmDeps = fetchNpmDeps { + inherit (finalAttrs) src; + name = "${finalAttrs.pname}-npm-deps"; + hash = npmHash; }; passthru = { @@ -55,27 +69,27 @@ let knownVulnerabilities = extraVulnerabilities ++ (lib.optional eol "Nextcloud version ${version} is EOL"); }; - }; + }); in { nextcloud28 = generic { version = "28.0.12"; - hash = "sha256-KgDKT3mTYPCYf8vIXZmywlj30sz35vfgxMzxehJ/AQU="; + hash = "sha256-YPqSc2xVw9e2ET9+VIaoSoo8L8SeuNFLUyq7Sj5RHhI="; + npmHash = "sha256-hZTfEZh1kT/n03wITxsHSM3COpwohIYAHtSf1N3iL4M="; packages = nextcloud28Packages; }; nextcloud29 = generic { version = "29.0.9"; - hash = "sha256-8U6PSXxtaysNpc0K0RbwyZ9yDE6wXmRDL72G4Jz7QUE="; + hash = "sha256-Vo8DTiv7IZaYhsa5T6AQtfXi2yRn444fXCfL7xPgXDo="; + npmHash = "sha256-InXHrwBbK+vS6ybx2tSNZ5+o7joniWSTsOfUvmYQoMU="; packages = nextcloud29Packages; }; nextcloud30 = generic { version = "30.0.2"; - hash = "sha256-kpu4BF6WIW/iKmXc1mJ55b17oauynZm/QB1CO2RqRF8="; + hash = "sha256-9slpR8n/sx/CS5QUtSnZZJEeSjn6pkKHCS8SwSb92RI="; + npmHash = "sha256-62/3TFu2z0xoqZTqqamrSscVQReh9bVjEHLGq5E0u4A="; packages = nextcloud30Packages; }; - - # tip: get the sha with: - # curl 'https://download.nextcloud.com/server/releases/nextcloud-${version}.tar.bz2.sha256' }