nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 cargo-tauri,
6 glib-networking,
7 nodejs,
8 libgudev,
9 systemdLibs,
10 fetchPnpmDeps,
11 pnpmConfigHook,
12 pnpm,
13 openssl,
14 nix-update-script,
15 pkg-config,
16 webkitgtk_4_1,
17 wrapGAppsHook4,
18 autoPatchelfHook,
19 fetchFromGitHub,
20}:
21rustPlatform.buildRustPackage (finalAttrs: {
22 pname = "sftool-gui";
23 version = "1.0.3";
24 src = fetchFromGitHub {
25 owner = "OpenSiFli";
26 repo = "sftool-gui";
27 tag = "v${finalAttrs.version}";
28 hash = "sha256-kjxUl9YrvTgJby+FvUbx5ugucK8NiBqzGBhTi9Zwd1s=";
29 };
30
31 cargoHash = "sha256-XAU3ru+TxUo99OQwcXNLJ8gzBOZUkC8UCAApz7M/QTM=";
32 cargoRoot = "src-tauri";
33
34 pnpmDeps = fetchPnpmDeps {
35 fetcherVersion = 2;
36 inherit (finalAttrs) pname version src;
37 hash = "sha256-gamgu9koBf+JLDswi3eGXRZybF8UiYE8CoifpQCgLaI=";
38 };
39
40 nativeBuildInputs = [
41 cargo-tauri.hook
42 pnpmConfigHook
43 pnpm
44 nodejs
45 pkg-config
46 ]
47 ++ lib.optionals stdenv.hostPlatform.isLinux [
48 wrapGAppsHook4
49 autoPatchelfHook
50 ];
51
52 buildInputs = [
53 openssl
54 ]
55 ++ lib.optionals stdenv.hostPlatform.isLinux [
56 glib-networking # Most Tauri apps need networking
57 webkitgtk_4_1
58 libgudev
59 systemdLibs
60 ];
61
62 # Set our Tauri source directory
63 # And make sure we build there too
64 buildAndTestSubdir = finalAttrs.cargoRoot;
65
66 passthru = {
67 inherit (finalAttrs) pnpmDeps;
68 updateScript = nix-update-script { };
69 };
70
71 meta = {
72 description = "Download tool for the SiFli family of chips";
73 homepage = "https://github.com/OpenSiFli/sftool-gui";
74 license = lib.licenses.asl20;
75 maintainers = [ ];
76 mainProgram = "sftool";
77 };
78})