1 { lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
2 , asar, alsa-lib, gtk3, libxshmfence, mesa, nss }:
4 stdenv.mkDerivation rec {
9 url = "https://dl.todesktop.com/210203cqcj00tw1/versions/${version}/linux/deb";
10 hash = "sha256-ZKlj/QuQnrqQepsJY6KCROC2fXK/4Py5tmI/FVnRi9w=";
20 buildInputs = [ alsa-lib gtk3 libxshmfence mesa nss ];
23 dpkg-deb -x ${src} ./morgen-${pname}
32 asar extract $out/opt/Morgen/resources/app.asar "$TMP/work"
33 # 1. Fixes path for todesktop-runtime-config.json
34 # 2. Fixes startup script
35 substituteInPlace $TMP/work/dist/main.js \
36 --replace "process.resourcesPath,\"todesktop-runtime-config.json" "\"$out/opt/Morgen/resources/todesktop-runtime-config.json" \
37 --replace "Exec=\".concat(process.execPath," "Exec=\".concat(\"$out/bin/morgen\","
38 asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" $out/opt/Morgen/resources/app.asar
40 substituteInPlace $out/share/applications/morgen.desktop \
41 --replace '/opt/Morgen' $out/bin
43 makeWrapper ${electron}/bin/electron $out/bin/morgen \
44 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer}} $out/opt/Morgen/resources/app.asar"
49 passthru.updateScript = ./update.sh;
52 description = "All-in-one Calendars, Tasks and Scheduler";
53 homepage = "https://morgen.so/download";
54 mainProgram = "morgen";
55 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
56 license = licenses.unfree;
57 maintainers = with maintainers; [ justanotherariel ];
58 platforms = [ "x86_64-linux" ];