10 , desktopToDarwinBundle
14 stdenv.mkDerivation (finalAttrs: {
18 src = fetchFromGitHub {
20 repo = "Micropad-Electron";
21 rev = "v${finalAttrs.version}";
22 hash = "sha256-z+g+FwmoX4Qqf+v4BVLCtfrXwGiAUFlPLQQhp2CMhLU=";
25 # This project can't be built from source currently, because Nixpkgs lacks
26 # ecosystem for https://bun.sh
27 micropad-core = fetchzip {
28 url = "https://github.com/MicroPad/MicroPad-Core/releases/download/v${finalAttrs.version}/micropad.tar.xz";
29 hash = "sha256-y13PVA/AKKsc5q7NDwZFasb7fOo+56IW8qbTbsm2WWc=";
32 offlineCache = fetchYarnDeps {
33 yarnLock = "${finalAttrs.src}/yarn.lock";
34 hash = "sha256-ESYSHuHLNsn3EYKIe2p0kg142jyC0USB+Ef//oGeF08=";
37 nativeBuildInputs = [ yarnBuildHook copyDesktopItems makeWrapper ]
38 ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ];
44 mkdir -p "$out/share/"
45 cp -r './deps/micropad' "$out/share/micropad"
46 ln -s '${finalAttrs.micropad-core}' "$out/share/micropad/core"
47 rm "$out/share/micropad/node_modules"
48 cp -r './node_modules' "$out/share/micropad"
51 for icon in $out/share/micropad/build/icons/*.png; do
52 mkdir -p "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps"
53 ln -s "$icon" "$out/share/icons/hicolor/$(basename $icon .png | sed -e 's/^icon-//')/apps/micropad.png"
57 makeWrapper '${electron}/bin/electron' "$out/bin/micropad" \
58 --add-flags "$out/share/micropad" \
59 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
64 # Do not attempt generating a tarball for micropad again.
67 # The desktop item properties should be kept in sync with data from upstream:
68 # https://github.com/MicroPad/MicroPad-Electron/blob/master/package.json
75 startupWMClass = "µPad";
76 comment = finalAttrs.meta.description;
77 categories = ["Office"];
82 description = "A powerful note-taking app that helps you organise + take notes without restrictions";
83 homepage = "https://getmicropad.com/";
84 license = lib.licenses.mpl20;
85 maintainers = with lib.maintainers; [rhysmdnz];
86 inherit (electron.meta) platforms;
87 mainProgram = "micropad";