-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
/
package.nix
134 lines (121 loc) · 3.28 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{ buildGoModule
, cairo
, cargo
, cargo-tauri
, esbuild
, fetchFromGitHub
, gdk-pixbuf
, glib-networking
, gobject-introspection
, lib
, libsoup_3
, makeBinaryWrapper
, nodejs
, openssl
, pango
, pkg-config
, pnpm
, rustc
, rustPlatform
, stdenv
, webkitgtk_4_1
}:
let
cargo-tauri_2 = let
version = "2.0.0-rc.3";
src = fetchFromGitHub {
owner = "tauri-apps";
repo = "tauri";
rev = "tauri-v${version}";
hash = "sha256-PV8m/MzYgbY4Hv71dZrqVbrxmxrwFfOAraLJIaQk6FQ=";
};
in cargo-tauri.overrideAttrs (drv: {
inherit src version;
cargoDeps = drv.cargoDeps.overrideAttrs (lib.const {
inherit src;
name = "tauri-${version}-vendor.tar.gz";
outputHash = "sha256-BrIH0JkGMp68O+4B+0g7X3lSdNSPXo+otlBgslCzPZE=";
});
});
esbuild_21-5 = let
version = "0.21.5";
in esbuild.override {
buildGoModule = args:
buildGoModule (args // {
inherit version;
src = fetchFromGitHub {
owner = "evanw";
repo = "esbuild";
rev = "v${version}";
hash = "sha256-FpvXWIlt67G8w3pBKZo/mcp57LunxDmRUaCU/Ne89B8=";
};
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
});
};
in stdenv.mkDerivation (finalAttrs: {
pname = "surrealist";
version = "2.1.6";
src = fetchFromGitHub {
owner = "surrealdb";
repo = "surrealist";
rev = "surrealist-v${finalAttrs.version}";
hash = "sha256-jOjOdrVOcGPenFW5mkkXKA64C6c+/f9KzlvtUmw6vXc=";
};
# HACK: A dependency (surrealist -> tauri -> **reqwest**) contains hyper-tls
# as an actually optional dependency. It ends up in the `Cargo.lock` file of
# tauri, but not in the one of surrealist. We apply a patch to `Cargo.toml`
# and `Cargo.lock` to ensure that we have it in our vendor archive. This may
# be a result of the following bug:
# https://github.com/rust-lang/cargo/issues/10801
patches = [
./0001-Cargo.patch
];
cargoDeps = rustPlatform.fetchCargoTarball {
inherit (finalAttrs) patches src;
sourceRoot = finalAttrs.cargoRoot;
name = "${finalAttrs.pname}-${finalAttrs.version}";
hash = "sha256-LtQS0kH+2P4odV7BJYiH6T51+iZHAM9W9mV96rNfNWs=";
};
pnpmDeps = pnpm.fetchDeps {
inherit (finalAttrs) pname version src;
hash = "sha256-Y14wBYiAsctMf4Ljt7G/twGEQP2nCSDQZVG8otImnIE=";
};
nativeBuildInputs = [
cargo
(cargo-tauri.hook.override { cargo-tauri = cargo-tauri_2; })
gobject-introspection
makeBinaryWrapper
nodejs
pnpm.configHook
pkg-config
rustc
rustPlatform.cargoSetupHook
];
buildInputs = [
cairo
gdk-pixbuf
libsoup_3
openssl
pango
webkitgtk_4_1
];
env = {
ESBUILD_BINARY_PATH = lib.getExe esbuild_21-5;
OPENSSL_NO_VENDOR = 1;
};
cargoRoot = "src-tauri";
buildAndTestSubdir = finalAttrs.cargoRoot;
postFixup = ''
wrapProgram "$out/bin/surrealist" \
--set GIO_EXTRA_MODULES ${glib-networking}/lib/gio/modules \
--set WEBKIT_DISABLE_COMPOSITING_MODE 1
'';
meta = with lib; {
description = "Surrealist is the ultimate way to visually manage your SurrealDB database";
homepage = "https://surrealdb.com/surrealist";
license = licenses.mit;
mainProgram = "surrealist";
maintainers = with maintainers; [ frankp ];
platforms = platforms.linux;
};
})