From 4647abad64e0367f0d619205e50938cf9437486e Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 17 Jan 2025 23:56:36 -0500 Subject: [PATCH] feat(desktop): add obsidian package --- .../desktop/environment/modules/packages.nix | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/desktop/environment/modules/packages.nix b/modules/desktop/environment/modules/packages.nix index 6fd97c92..3629aeb7 100644 --- a/modules/desktop/environment/modules/packages.nix +++ b/modules/desktop/environment/modules/packages.nix @@ -168,6 +168,29 @@ in { vesktop # screen-sharing on desktop ; + # force XWayland for stylus input + obsidian = pkgs.obsidian.overrideAttrs (o: { + installPhase = '' + runHook preInstall + mkdir -p $out/bin + + makeWrapper ${pkgs.electron}/bin/electron $out/bin/obsidian \ + --add-flags $out/share/obsidian/app.asar \ + --set XDG_SESSION_TYPE "x11" \ + --set NIXOS_OZONE_WL "0" + + install -m 444 -D resources/app.asar $out/share/obsidian/app.asar + install -m 444 -D resources/obsidian.asar $out/share/obsidian/obsidian.asar + install -m 444 -D "${o.desktopItem}/share/applications/"* \ + -t $out/share/applications/ + for size in 16 24 32 48 64 128 256 512; do + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps + magick -background none ${o.icon} -resize "$size"x"$size" $out/share/icons/hicolor/"$size"x"$size"/apps/obsidian.png + done + runHook postInstall + ''; + }); + # tools inherit (pkgs)