1 { lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
2 , nodePackages, alsa-lib, gtk3, libxshmfence, mesa, nss }:
4 stdenv.mkDerivation rec {
9 url = "https://download.todesktop.com/210203cqcj00tw1/morgen-${version}.deb";
10 sha256 = "sha256-U77yOgQNSj1p3WZbwkyq0Ui2UrXeuAv5sD7L+ZI2x24=";
20 buildInputs = [ alsa-lib gtk3 libxshmfence mesa nss ];
26 dpkg-deb -x ${src} ./morgen-${pname}
35 asar extract $out/opt/Morgen/resources/app.asar "$TMP/work"
36 # 1. Fixes path for todesktop-runtime-config.json
37 # 2. Fixes startup script
38 substituteInPlace $TMP/work/dist/main.js \
39 --replace "process.resourcesPath,\"todesktop-runtime-config.json" "\"$out/opt/Morgen/resources/todesktop-runtime-config.json" \
40 --replace "Exec=\"+process.execPath+\"" "Exec=$out/bin/morgen"
41 asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" $out/opt/Morgen/resources/app.asar
43 substituteInPlace $out/share/applications/morgen.desktop \
44 --replace '/opt/Morgen' $out/bin
46 makeWrapper ${electron}/bin/electron $out/bin/morgen \
47 --add-flags $out/opt/Morgen/resources/app.asar
53 description = "All-in-one Calendars, Tasks and Scheduler";
54 homepage = "https://morgen.so/download";
55 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
56 license = licenses.unfree;
57 maintainers = with maintainers; [ wolfangaukang ];
58 platforms = [ "x86_64-linux" ];