From a7b7c60952e228c2b9a6e8a95bc2cab1e74ceee7 Mon Sep 17 00:00:00 2001 From: Mirza Arnaut Date: Tue, 23 Jun 2026 14:21:33 +0200 Subject: [PATCH 1/2] stump: refactor to utilize finalAttrs While the functional behaviour was introduced, the stump package hasn't been using it much and instead utilized a let-in block. The contents of the let-in block has been moved inside and the derivation function and the `finalAttrs` argument has been used where needed. This will enable easier automatic updates using nix-update-script (see next commit). --- pkgs/by-name/st/stump/package.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/st/stump/package.nix b/pkgs/by-name/st/stump/package.nix index 7045bcb575d4..614b50bbd4ac 100644 --- a/pkgs/by-name/st/stump/package.nix +++ b/pkgs/by-name/st/stump/package.nix @@ -17,19 +17,20 @@ pkg-config, makeWrapper, }: -let +rustPlatform.buildRustPackage (finalAttrs: { + pname = "stump"; version = "0.1.5"; src = fetchFromGitHub { owner = "stumpapp"; repo = "stump"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-kstMk4HJopLHW22ynVZF0itWUixwiDkbsMUpYMvw1Ag="; }; - frontend = stdenv.mkDerivation (finalAttrs: { + frontend = stdenv.mkDerivation (_: { pname = "stump-frontend"; - inherit src version; + inherit (finalAttrs) src version; yarnOfflineCache = fetchYarnDeps { yarnLock = finalAttrs.src + "/yarn.lock"; @@ -55,10 +56,6 @@ let mv ./apps/web/dist $out ''; }); -in -rustPlatform.buildRustPackage (finalAttrs: { - pname = "stump"; - inherit src version; __structuredAttrs = true; @@ -71,7 +68,7 @@ rustPlatform.buildRustPackage (finalAttrs: { "stump_server" ]; - env.GIT_REV = "v${version}"; + env.GIT_REV = "v${finalAttrs.version}"; nativeBuildInputs = [ pkg-config @@ -97,7 +94,7 @@ rustPlatform.buildRustPackage (finalAttrs: { postInstall = '' wrapProgram $out/bin/stump_server \ --set-default STUMP_CONFIG_DIR /var/lib/stump/config \ - --set-default STUMP_CLIENT_DIR ${frontend} \ + --set-default STUMP_CLIENT_DIR ${finalAttrs.frontend} \ --set-default STUMP_PORT 10001 \ --set-default STUMP_PROFILE release \ --set-default PDFIUM_PATH ${pdfium-binaries}/lib/libpdfium.so \ From 4387325b40b42d72a67e467b7298a56a3b1e0a96 Mon Sep 17 00:00:00 2001 From: Mirza Arnaut Date: Tue, 23 Jun 2026 14:22:28 +0200 Subject: [PATCH 2/2] stump: enable auto update PRs via nix-update-script --- pkgs/by-name/st/stump/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/st/stump/package.nix b/pkgs/by-name/st/stump/package.nix index 614b50bbd4ac..e926c610f82e 100644 --- a/pkgs/by-name/st/stump/package.nix +++ b/pkgs/by-name/st/stump/package.nix @@ -16,6 +16,7 @@ cacert, pkg-config, makeWrapper, + nix-update-script, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "stump"; @@ -101,7 +102,15 @@ rustPlatform.buildRustPackage (finalAttrs: { --set-default API_VERSION v1 ''; - passthru.tests = nixosTests.stump; + passthru = { + tests = nixosTests.stump; + updateScript = nix-update-script { + extraArgs = [ + "--subpackage" + "frontend" + ]; + }; + }; meta = { homepage = "https://stumpapp.dev/";