From e0f63ad971803b4d9457b1578902e39cadef6b29 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 18 Oct 2024 18:13:17 +0200 Subject: [PATCH 1/2] wiki-js: 2.5.304 -> 2.5.305 ChangeLog: https://github.com/requarks/wiki/releases/tag/v2.5.305 --- pkgs/servers/web-apps/wiki-js/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/web-apps/wiki-js/default.nix b/pkgs/servers/web-apps/wiki-js/default.nix index 5816e1dd91be..23d96bc39ef7 100644 --- a/pkgs/servers/web-apps/wiki-js/default.nix +++ b/pkgs/servers/web-apps/wiki-js/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "wiki-js"; - version = "2.5.304"; + version = "2.5.305"; src = fetchurl { url = "https://github.com/Requarks/wiki/releases/download/v${version}/${pname}.tar.gz"; - sha256 = "sha256-w89+X3sqZPlX7EuK/g2oATHqlpx1br/Njh81vZt8zYM="; + sha256 = "sha256-beP9k1msJjg9IQbU/CmzTodjMvUnWrLYcw0EleR1OJk="; }; sourceRoot = "."; From 3dc2d959720359f2e61254d237dc1e8ede3d883f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 18 Oct 2024 18:22:17 +0200 Subject: [PATCH 2/2] wiki-js: unpack into `source` We effectively copy everything into `$out` (but this isn't using `buildCommand` to allow applying custom patches). However, this had the effect that `env-vars` was also copied into `$out` retaining a reference to the source tarball. Removing that reduces the closure size from 765.5M to 388.8M, i.e. by about 50.7%. --- pkgs/servers/web-apps/wiki-js/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/servers/web-apps/wiki-js/default.nix b/pkgs/servers/web-apps/wiki-js/default.nix index 23d96bc39ef7..362230da8dd2 100644 --- a/pkgs/servers/web-apps/wiki-js/default.nix +++ b/pkgs/servers/web-apps/wiki-js/default.nix @@ -9,6 +9,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-beP9k1msJjg9IQbU/CmzTodjMvUnWrLYcw0EleR1OJk="; }; + # Unpack the tarball into a subdir. All the contents are copied into `$out`. + # Unpacking into the parent directory would also copy `env-vars` into `$out` + # in the `installPhase` which ultimately means that the package retains + # references to build tools and the tarball. + preUnpack = '' + mkdir source + cd source + ''; + sourceRoot = "."; dontBuild = true;