Skip to content

Commit 66282ee

Browse files
authored
fedistar: combine frontend into main derivation (#407162)
2 parents b63b1ae + c2a28ad commit 66282ee

File tree

1 file changed

+17
-43
lines changed

1 file changed

+17
-43
lines changed

pkgs/by-name/fe/fedistar/package.nix

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,65 +15,39 @@
1515
webkitgtk_4_1,
1616
openssl,
1717
}:
18+
1819
let
1920
pnpm = pnpm_10;
21+
in
22+
rustPlatform.buildRustPackage (finalAttrs: {
2023
pname = "fedistar";
2124
version = "1.11.3";
25+
2226
src = fetchFromGitHub {
2327
owner = "h3poteto";
2428
repo = "fedistar";
25-
tag = "v${version}";
29+
tag = "v${finalAttrs.version}";
2630
hash = "sha256-Q2j6K4ys/z77+n3kdGJ15rWbFlbbIHBWB9hOARsgg2A=";
2731
};
28-
fedistar-frontend = stdenvNoCC.mkDerivation (finalAttrs: {
29-
pname = "fedistar-frontend";
30-
inherit version src;
31-
pnpmDeps = pnpm.fetchDeps {
32-
inherit pname version src;
33-
hash = "sha256-xXVsjAXmrsOp+mXrYAxSKz4vX5JApLZ+Rh6hrYlnJDI=";
34-
};
35-
nativeBuildInputs = [
36-
pnpm.configHook
37-
pnpm
38-
nodejs
39-
];
40-
41-
buildPhase = ''
42-
runHook preBuild
43-
pnpm run build
44-
runHook postBuild
45-
'';
4632

47-
installPhase = ''
48-
runHook preInstall
49-
mkdir -p $out
50-
cp -r out/* $out/
51-
runHook postInstall
52-
'';
53-
});
54-
55-
in
56-
rustPlatform.buildRustPackage {
57-
inherit
58-
pname
59-
version
60-
src
61-
fedistar-frontend
62-
;
63-
sourceRoot = "${src.name}/src-tauri";
33+
cargoRoot = "src-tauri";
34+
buildAndTestSubdir = "src-tauri";
6435

6536
useFetchCargoVendor = true;
6637
cargoHash = "sha256-ZJgyrFDtzAH3XqDdnJ27Yn+WsTMrZR2+lnkZ6bw6hzg=";
6738

68-
postPatch = ''
69-
substituteInPlace ./tauri.conf.json \
70-
--replace-fail '"frontendDist": "../out",' '"frontendDist": "${fedistar-frontend}",' \
71-
--replace-fail '"beforeBuildCommand": "pnpm build",' '"beforeBuildCommand": "",'
72-
'';
39+
pnpmDeps = pnpm.fetchDeps {
40+
inherit (finalAttrs) pname version src;
41+
hash = "sha256-xXVsjAXmrsOp+mXrYAxSKz4vX5JApLZ+Rh6hrYlnJDI=";
42+
};
7343

7444
nativeBuildInputs = [
7545
cargo-tauri.hook
7646

47+
pnpm.configHook
48+
pnpm
49+
nodejs
50+
7751
pkg-config
7852
wrapGAppsHook4
7953
];
@@ -107,6 +81,6 @@ rustPlatform.buildRustPackage {
10781
mainProgram = "fedistar";
10882
license = lib.licenses.gpl3Only;
10983
maintainers = with lib.maintainers; [ noodlez1232 ];
110-
changelog = "https://github.com/h3poteto/fedistar/releases/tag/v${version}";
84+
changelog = "https://github.com/h3poteto/fedistar/releases/tag/v${finalAttrs.version}";
11185
};
112-
}
86+
})

0 commit comments

Comments
 (0)