-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpackage.nix
More file actions
107 lines (89 loc) · 1.98 KB
/
package.nix
File metadata and controls
107 lines (89 loc) · 1.98 KB
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
{
lib,
fetchYarnDeps,
gtk3,
glib-networking,
mkYarnPackage,
pkg-config,
rustPlatform,
webkitgtk,
cairo,
gdk-pixbuf,
glib,
dbus,
openssl_3,
librsvg,
cargo-tauri,
makeWrapper,
}:
let
pname = "dakko";
version = "0.0.1";
frontend-build = mkYarnPackage {
inherit version;
pname = "dakko-ui";
src = ./.;
offlineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
sha256 = "sha256-iyIylYMqnsYTpW+D+fMs0AwrLZqcVeGN7SspyAFKyjE=";
};
packageJSON = ./package.json;
buildPhase = ''
export HOME=$(mktemp -d)
yarn --offline build
mkdir -p $out
cp -r deps/dakko/build $out
'';
distPhase = "true";
dontInstall = true;
};
in
rustPlatform.buildRustPackage {
inherit version pname;
src = ./src-tauri;
cargoLock = {
lockFile = ./src-tauri/Cargo.lock;
};
postPatch = ''
substituteInPlace tauri.conf.json --replace-fail '"distDir": "../build"' '"distDir": "${frontend-build}/build"'
substituteInPlace tauri.conf.json --replace-fail '"beforeBuildCommand": "yarn build"' '"beforeBuildCommand": ""'
'';
buildPhase = ''
runHook preBuild
cargo tauri build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv target/release/dakko $out/bin/dakko_unwrapped
makeWrapper $out/bin/dakko_unwrapped $out/bin/dakko \
--set WEBKIT_DISABLE_COMPOSITING_MODE 1 \
--prefix GIO_MODULE_DIR : ${glib-networking}/lib/gio/modules/
runHook postInstall
'';
buildInputs = [
webkitgtk
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
librsvg
glib-networking
];
nativeBuildInputs = [
pkg-config
cargo-tauri
makeWrapper
];
doCheck = false;
meta = {
description = "A [more] native[ly integrated] Fediverse client";
homepage = "https://github.com/nullishamy/dakko";
license = lib.licenses.osl3;
mainProgram = "dakko";
maintainers = with lib.maintainers; [ nullishamy ];
};
}