-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathpackage.nix
50 lines (43 loc) · 1.18 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
{ lib
, stdenv
, darwin
, fetchFromGitHub
, rustPlatform
, buildNpmPackage
}:
let
pname = "sql-studio";
version = "0.1.35";
src = fetchFromGitHub {
owner = "frectonz";
repo = pname;
rev = version;
hash = "sha256-ZWGV4DYf+85LIGVDc8hcWSEJsM6UisuCB2Wd2kiw/sk=";
};
ui = buildNpmPackage {
inherit version src;
pname = "${pname}-ui";
npmDepsHash = "sha256-NCq8RuaC+dO6Zbgl1ucJxhJrVZ69Va3b2/gYn4fThAw=";
sourceRoot = "${src.name}/ui";
installPhase = ''
cp -pr --reflink=auto -- dist "$out/"
'';
};
in
rustPlatform.buildRustPackage {
inherit pname version src;
useFetchCargoVendor = true;
cargoHash = "sha256-rWG5iPXiG7kCf0yLAqcQi8AM3qv/WTUiY4cVrjpUc/Y=";
preBuild = ''
cp -pr --reflink=auto -- ${ui} ui/dist
'';
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Foundation ];
meta = {
description = "SQL Database Explorer [SQLite, libSQL, PostgreSQL, MySQL/MariaDB, DuckDB, ClickHouse]";
homepage = "https://github.com/frectonz/sql-studio";
mainProgram = "sql-studio";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.frectonz ];
platforms = lib.platforms.all;
};
}