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).
This commit is contained in:
Mirza Arnaut
2026-06-23 14:21:33 +02:00
parent 4599616e95
commit a7b7c60952
+7 -10
View File
@@ -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 \