-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
/
Copy pathdefault.nix
57 lines (45 loc) · 1.9 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{ lib, stdenv, fetchurl, dpkg, autoPatchelfHook, makeWrapper, electron
, asar, alsa-lib, gtk3, libxshmfence, libgbm, nss }:
stdenv.mkDerivation rec {
pname = "morgen";
version = "3.5.9";
src = fetchurl {
name = "morgen-${version}.deb";
url = "https://dl.todesktop.com/210203cqcj00tw1/versions/${version}/linux/deb";
hash = "sha256-ZKlj/QuQnrqQepsJY6KCROC2fXK/4Py5tmI/FVnRi9w=";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
makeWrapper
asar
];
buildInputs = [ alsa-lib gtk3 libxshmfence libgbm nss ];
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" \
--replace "Exec=\".concat(process.execPath," "Exec=\".concat(\"$out/bin/morgen\","
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 \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --enable-wayland-ime=true}} $out/opt/Morgen/resources/app.asar"
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "All-in-one Calendars, Tasks and Scheduler";
homepage = "https://morgen.so/download";
mainProgram = "morgen";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ justanotherariel ];
platforms = [ "x86_64-linux" ];
};
}