nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cargo-tauri,
3 fetchFromGitHub,
4 fetchNpmDeps,
5 glib-networking,
6 lib,
7 nodejs,
8 npmHooks,
9 pkg-config,
10 rustPlatform,
11 stdenv,
12 webkitgtk_4_1,
13 wrapGAppsHook4,
14
15 nix-update-script,
16}:
17
18rustPlatform.buildRustPackage (finalAttrs: {
19 pname = "venator";
20 version = "1.0.4";
21
22 src = fetchFromGitHub {
23 owner = "kmdreko";
24 repo = "venator";
25 tag = "v${finalAttrs.version}";
26 hash = "sha256-qjSB/XAxB/VbO4m9Gg/XP9332WaSm/d/ejSTrHRchHg=";
27 };
28
29 cargoRoot = "venator-app";
30 buildAndTestSubdir = "venator-app";
31 # NOTE: don't put npmRoot here because it will break the build with "Found
32 # version mismatched Tauri packages".
33 #
34 # Nasty workaround to `npmRoot` not working. I don't know man...
35 postPatch = ''
36 cp ${finalAttrs.src}/venator-app/package.json .
37 cp ${finalAttrs.src}/venator-app/package-lock.json .
38 cp ${finalAttrs.src}/Cargo.lock venator-app/
39 '';
40
41 cargoHash = "sha256-OLtWDJuK9fXbpjUfidLP2nKdD49cWmqWI92bhV29054=";
42
43 npmDeps = fetchNpmDeps {
44 src = "${finalAttrs.src}/venator-app";
45 hash = "sha256-DnpqX+B0s2d5GwftPh2rpBvUuZpzG+i4+jdgcaB7fIg=";
46 };
47
48 nativeBuildInputs = [
49 cargo-tauri.hook
50 nodejs
51 npmHooks.npmConfigHook
52 pkg-config
53 ]
54 ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook4 ];
55
56 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
57 glib-networking
58 webkitgtk_4_1
59 ];
60
61 passthru.updateScript = nix-update-script { };
62
63 meta = {
64 description = "Desktop app for viewing logs and traces from OpenTelemetry and the Rust tracing ecosystem";
65 homepage = "https://github.com/kmdreko/venator";
66 license = lib.licenses.mit;
67 mainProgram = "venator";
68 maintainers = [
69 lib.maintainers.frankp
70 lib.maintainers._9999years
71 ];
72 };
73})