Skip to content

Build your personal knowledge base with Trilium Notes

feat(flake): Wayland support

FliegendeWurste8f2f0f5778d
diff --git a/flake.nix b/flake.nix
index 125992fa5f..318d6e8308 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,6 +30,7 @@
lib
makeBinaryWrapper
makeDesktopItem
+ makeShellWrapper
moreutils
removeReferencesTo
stdenv
@@ -102,15 +103,20 @@
extraNativeBuildInputs =
[
- makeBinaryWrapper
moreutils # sponge
nodejs.python
removeReferencesTo
]
++ lib.optionals (app == "desktop") [
copyDesktopItems
+ # required for NIXOS_OZONE_WL expansion
+ # https://github.com/NixOS/nixpkgs/issues/172583
+ makeShellWrapper
wrapGAppsHook3
]
+ ++ lib.optionals (app == "server") [
+ makeBinaryWrapper
+ ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
xcodebuild
darwin.cctools
@@ -187,8 +193,9 @@
mkdir -p $out/{bin,share/icons/hicolor/512x512/apps,opt/trilium}
cp --archive apps/desktop/dist/* $out/opt/trilium
cp apps/client/src/assets/icon.png $out/share/icons/hicolor/512x512/apps/trilium.png
- makeWrapper ${lib.getExe electron} $out/bin/trilium \
+ makeShellWrapper ${lib.getExe electron} $out/bin/trilium \
"''${gappsWrapperArgs[@]}" \
+ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--set-default ELECTRON_IS_DEV 0 \
--add-flags $out/opt/trilium/main.cjs
'';