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
135
|
{
lib,
stdenv,
rustPlatform,
fetchFromForgejo,
buildNpmPackage,
cargo-tauri,
glib-networking,
gst_all_1,
libayatana-appindicator,
libsecret,
nodejs,
perl,
pkg-config,
tinymist,
webkitgtk_4_1,
wrapGAppsHook4,
}:
let
version = "26.9.6";
src = fetchFromForgejo {
domain = "codefloe.com";
owner = "InkyCap";
repo = "app";
tag = "v${version}";
hash = "sha256-X4KjRHUDYx0C61gBa5vr9i1u0DOZok1AUTwe6srVhy4=";
};
changelog = "https://codefloe.com/InkyCap/app/releases/tag/v${version}";
homepage = "http://inkycap.org/";
license = lib.licenses.liliq-p-11;
maintainers = with lib.maintainers; [ luker ];
# from TINYMIST_VERSION in scripts/download-tinymist.sh.
# developer says it should work with newer version, but no guarantees.
requiredTinymistVersion = "0.15.2";
frontend = buildNpmPackage (finalAttrs: {
pname = "inkycap-frontend";
inherit version src;
npmDepsHash = "sha256-vXf4W3U5EIzqHRdUkIy1z+0+umMbR1AflQ31pJCo37M=";
# The npm hook installs with `npm ci --ignore-scripts`, so the
# postinstall script (patch-package) never runs. Apply the patches
# from patches/ explicitly, before the bundle.
preBuild = ''
./node_modules/.bin/patch-package
'';
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
meta = {
inherit
changelog
homepage
license
maintainers
;
description = "Frontend assets for InkyCap";
};
});
in
assert (builtins.compareVersions requiredTinymistVersion tinymist.version) <= 0;
rustPlatform.buildRustPackage (finalAttrs: {
pname = "inkycap";
inherit version src;
__structuredAttrs = true;
cargoRoot = "src-tauri";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src cargoRoot;
hash = "sha256-NHlLURI2O2W28gAWGZd6Hx7lWOXn8LNeoiubReRA5Bo=";
};
buildAndTestSubdir = "src-tauri";
nativeBuildInputs = [
cargo-tauri.hook
pkg-config
perl
wrapGAppsHook4
];
buildInputs = [
glib-networking
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-good
gst_all_1.gst-libav
libayatana-appindicator
libsecret
webkitgtk_4_1
];
postPatch = ''
# Tauri expects sidecars as binaries/<name>-<triple>.
# make sure nixpkgs version and package version are synchronized
install -Dm755 ${tinymist}/bin/tinymist \
"src-tauri/binaries/inkycap-tinymist-${stdenv.hostPlatform.rust.rustcTargetSpec}"
cp -r ${frontend} dist
# The frontend is already built; drop beforeBuildCommand so the
# tauri CLI does not re-run `npm run build`
substituteInPlace src-tauri/tauri.conf.json \
--replace-fail '"beforeBuildCommand": "npm run build"' "" \
--replace-fail '"beforeDevCommand": "npm run dev",' '"beforeDevCommand": "npm run dev"'
'';
doCheck = false;
meta = {
inherit
changelog
homepage
license
maintainers
;
description = "Personal knowledge management (PKM) tool that uses Typst markup";
longDescription = ''
InkyCap is a personal knowledge management tool that helps you explore
ideas and write. Tailored for academic workflows, research, writing,
task and date awareness; InkyCap provides flexible ways to organize
your information.
'';
platforms = lib.platforms.linux;
mainProgram = "inkycap";
};
})
|