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