11 desktopToDarwinBundle,
15 stdenv.mkDerivation (finalAttrs: {
19 src = fetchFromGitHub {
21 repo = "Micropad-Electron";
22 rev = "v${finalAttrs.version}";
23 hash = "sha256-z+g+FwmoX4Qqf+v4BVLCtfrXwGiAUFlPLQQhp2CMhLU=";
26 # This project can't be built from source currently, because Nixpkgs lacks
27 # ecosystem for https://bun.sh
28 micropad-core = fetchzip {
29 url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${finalAttrs.version}/micropad.tar.xz";
30 hash = "sha256-y13PVA/AKKsc5q7NDwZFasb7fOo+56IW8qbTbsm2WWc=";
33 offlineCache = fetchYarnDeps {
34 yarnLock = "${finalAttrs.src}/yarn.lock";
35 hash = "sha256-ESYSHuHLNsn3EYKIe2p0kg142jyC0USB+Ef//oGeF08=";
42 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ];
48 mkdir -p "$out/share/"
49 cp -r './deps/micropad' "$out/share/micropad"
50 ln -s '${finalAttrs.micropad-core}' "$out/share/micropad/core"
51 rm "$out/share/micropad/node_modules"
52 cp -r './node_modules' "$out/share/micropad"
55 for icon in $out/share/micropad/build/icons/*.png; do
56 mkdir -p "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps"
57 ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps/micropad.png"
61 makeWrapper '${electron}/bin/electron' "$out/bin/micropad" \
62 --add-flags "$out/share/micropad" \
63 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
68 # Do not attempt generating a tarball for micropad again.
71 # The desktop item properties should be kept in sync with data from upstream:
72 # https://github.com/MicroPad/MicroPad-Electron/blob/master/package.json
79 startupWMClass = "µPad";
80 comment = finalAttrs.meta.description;
81 categories = [ "Office" ];
86 description = "A powerful note-taking app that helps you organise + take notes without restrictions";
87 homepage = "https://getmicropad.com/";
88 license = lib.licenses.mpl20;
89 maintainers = with lib.maintainers; [ rhysmdnz ];
90 inherit (electron.meta) platforms;
91 mainProgram = "micropad";