@jaspermayone.com's dotfiles
1{
2 lib,
3 stdenvNoCC,
4 fetchFromGitHub,
5 bun,
6 makeWrapper,
7}:
8
9stdenvNoCC.mkDerivation rec {
10 pname = "qmd";
11 version = "unstable-2025-02-01";
12
13 src = fetchFromGitHub {
14 owner = "tobi";
15 repo = "qmd";
16 rev = "47b705409eb1427e574ce82c16e1860b216869ed";
17 hash = "sha256-mJxqZfTGjwHrZy0fxl3HA31Yg7YyIi876cXehmi0tIA=";
18 };
19
20 nativeBuildInputs = [
21 bun
22 makeWrapper
23 ];
24
25 buildPhase = ''
26 runHook preBuild
27 HOME=$TMPDIR bun install --frozen-lockfile --no-progress
28 runHook postBuild
29 '';
30
31 installPhase = ''
32 runHook preInstall
33
34 mkdir -p $out/lib/qmd $out/bin
35 cp -r . $out/lib/qmd/
36
37 # Use the existing qmd wrapper script, but ensure it finds our bun
38 makeWrapper $out/lib/qmd/qmd $out/bin/qmd \
39 --prefix PATH : ${lib.makeBinPath [ bun ]}
40
41 runHook postInstall
42 '';
43
44 meta = with lib; {
45 description = "On-device search engine for markdown notes and knowledge bases";
46 homepage = "https://github.com/tobi/qmd";
47 license = licenses.mit;
48 maintainers = [ ];
49 mainProgram = "qmd";
50 platforms = platforms.unix;
51 };
52}