10 , desktopToDarwinBundle
14 executableName = "micropad";
20 src = fetchFromGitHub {
22 repo = "Micropad-Electron";
24 hash = "sha256-z+g+FwmoX4Qqf+v4BVLCtfrXwGiAUFlPLQQhp2CMhLU=";
27 micropad-core = fetchzip {
28 url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${version}/micropad.tar.xz";
29 hash = "sha256-y13PVA/AKKsc5q7NDwZFasb7fOo+56IW8qbTbsm2WWc=";
32 packageJSON = ./package.json;
34 offlineCache = fetchYarnDeps {
35 yarnLock = "${src}/yarn.lock";
36 hash = "sha256-ESYSHuHLNsn3EYKIe2p0kg142jyC0USB+Ef//oGeF08=";
39 nativeBuildInputs = [ copyDesktopItems makeWrapper ]
40 ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
54 mkdir -p "$out/share/"
55 cp -r './deps/micropad' "$out/share/micropad"
56 ln -s '${micropad-core}' "$out/share/micropad/core"
57 rm "$out/share/micropad/node_modules"
58 cp -r './node_modules' "$out/share/micropad"
61 for icon in $out/share/micropad/build/icons/*.png; do
62 mkdir -p "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps"
63 ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps/micropad.png"
67 makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \
68 --add-flags "$out/share/micropad" \
69 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
74 # Do not attempt generating a tarball for micropad again.
77 # The desktop item properties should be kept in sync with data from upstream:
78 # https://github.com/MicroPad/MicroPad-Electron/blob/master/package.json
82 exec = "${executableName} %u";
85 startupWMClass = "µPad";
86 comment = meta.description;
87 categories = ["Office"];
91 passthru.updateScript = ./update.sh;
94 description = "A powerful note-taking app that helps you organise + take notes without restrictions";
95 homepage = "https://getmicropad.com/";
96 license = licenses.mpl20;
97 maintainers = with maintainers; [rhysmdnz];
98 inherit (electron.meta) platforms;
99 mainProgram = "micropad";