2022-02-10 20:34:41 +00:00
|
|
|
{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
|
2023-10-09 19:29:22 +00:00
|
|
|
, asar, alsa-lib, gtk3, libxshmfence, mesa, nss }:
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "morgen";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "3.4.4";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-13 08:15:51 +00:00
|
|
|
url = "https://dl.todesktop.com/210203cqcj00tw1/versions/${version}/linux/deb";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-l4wHCapIvD3kZk1DqLNWDLjwg6j7g0+qMB/KuMzH+pQ=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
autoPatchelfHook
|
|
|
|
makeWrapper
|
2023-10-09 19:29:22 +00:00
|
|
|
asar
|
2022-02-10 20:34:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ alsa-lib gtk3 libxshmfence mesa nss ];
|
|
|
|
|
|
|
|
unpackCmd = ''
|
|
|
|
dpkg-deb -x ${src} ./morgen-${pname}
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mv usr $out
|
|
|
|
mv opt $out
|
|
|
|
|
|
|
|
asar extract $out/opt/Morgen/resources/app.asar "$TMP/work"
|
|
|
|
# 1. Fixes path for todesktop-runtime-config.json
|
|
|
|
# 2. Fixes startup script
|
|
|
|
substituteInPlace $TMP/work/dist/main.js \
|
|
|
|
--replace "process.resourcesPath,\"todesktop-runtime-config.json" "\"$out/opt/Morgen/resources/todesktop-runtime-config.json" \
|
2023-02-02 18:25:31 +00:00
|
|
|
--replace "Exec=\".concat(process.execPath," "Exec=\".concat(\"$out/bin/morgen\","
|
2022-02-10 20:34:41 +00:00
|
|
|
asar pack --unpack='{*.node,*.ftz,rect-overlay}' "$TMP/work" $out/opt/Morgen/resources/app.asar
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/morgen.desktop \
|
|
|
|
--replace '/opt/Morgen' $out/bin
|
|
|
|
|
|
|
|
makeWrapper ${electron}/bin/electron $out/bin/morgen \
|
2024-04-21 15:54:59 +00:00
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer}} $out/opt/Morgen/resources/app.asar"
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "All-in-one Calendars, Tasks and Scheduler";
|
|
|
|
homepage = "https://morgen.so/download";
|
2024-01-13 08:15:51 +00:00
|
|
|
mainProgram = "morgen";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-02-10 20:34:41 +00:00
|
|
|
license = licenses.unfree;
|
2024-01-13 08:15:51 +00:00
|
|
|
maintainers = with maintainers; [ justanotherariel wolfangaukang ];
|
2022-02-10 20:34:41 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|