Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit e8f2f0f

Browse files
feat(flake): Wayland support
1 parent f56ba72 commit e8f2f0f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

flake.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
lib
3131
makeBinaryWrapper
3232
makeDesktopItem
33+
makeShellWrapper
3334
moreutils
3435
removeReferencesTo
3536
stdenv
@@ -102,15 +103,20 @@
102103

103104
extraNativeBuildInputs =
104105
[
105-
makeBinaryWrapper
106106
moreutils # sponge
107107
nodejs.python
108108
removeReferencesTo
109109
]
110110
++ lib.optionals (app == "desktop") [
111111
copyDesktopItems
112+
# required for NIXOS_OZONE_WL expansion
113+
# https://github.com/NixOS/nixpkgs/issues/172583
114+
makeShellWrapper
112115
wrapGAppsHook3
113116
]
117+
++ lib.optionals (app == "server") [
118+
makeBinaryWrapper
119+
]
114120
++ lib.optionals stdenv.hostPlatform.isDarwin [
115121
xcodebuild
116122
darwin.cctools
@@ -187,8 +193,9 @@
187193
mkdir -p $out/{bin,share/icons/hicolor/512x512/apps,opt/trilium}
188194
cp --archive apps/desktop/dist/* $out/opt/trilium
189195
cp apps/client/src/assets/icon.png $out/share/icons/hicolor/512x512/apps/trilium.png
190-
makeWrapper ${lib.getExe electron} $out/bin/trilium \
196+
makeShellWrapper ${lib.getExe electron} $out/bin/trilium \
191197
"''${gappsWrapperArgs[@]}" \
198+
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
192199
--set-default ELECTRON_IS_DEV 0 \
193200
--add-flags $out/opt/trilium/main.cjs
194201
'';

0 commit comments

Comments
 (0)