From 671d7197883c99591f9cec6231af5ddb937acc87 Mon Sep 17 00:00:00 2001
From: Grisha Shipunov <blame@oxapentane.com>
Date: Wed, 19 Mar 2025 14:00:07 +0100
Subject: [PATCH] fix xwayland

---
 modules/niri.nix | 100 ++++++++++++++++++++++++++++-------------------
 1 file changed, 60 insertions(+), 40 deletions(-)

diff --git a/modules/niri.nix b/modules/niri.nix
index ea0870a..c3438fc 100644
--- a/modules/niri.nix
+++ b/modules/niri.nix
@@ -9,46 +9,66 @@
     ./desktop-software.nix
     ./fonts.nix
   ];
-  environment.systemPackages = with pkgs; [
-    screen-message
-    qbittorrent
-    gajim
-    imv
-    mpv
-    evince
-    brightnessctl
-    pulsemixer
-    cmus
-    termusic
-    gsettings-desktop-schemas
-    xdg-utils
-    qt5.qtwayland
-    bashmount
-    audacity
-    spotify-player
-    zathura
-    ncdu
-    adwaita-icon-theme
-    bluetui
-    gammastep
-    graphicsmagick
-    i3status-rust
-    impala
-    kanshi
-    pamixer
-    swayidle
-    swaylock
-    wl-clipboard
-    xfce.thunar
-    banana-cursor
-    fuzzel
-    alacritty
-    i3bar-river
-    mako
-    swww
-    oculante
-    xwayland-satellite
-  ];
+  environment.systemPackages =
+    let
+      xwayland-satellite-git = pkgs.xwayland-satellite.overrideAttrs (
+        final: prev: {
+          version = "git";
+          cargoHash = "sha256-MaF2FyR3HvQAKkZKa8OO/5jbO64/Ncv7+JqHda4jN50=";
+          src = pkgs.fetchFromGitHub {
+            owner = "Supreeeme";
+            repo = "xwayland-satellite";
+            rev = "cca74a5f6b23742d77dc5db4312dfc40fd4a0fcc";
+            sha256 = "sha256-YZ+axsuNsgIKWfnRkt6Qa9UoKfUOIWf42vNUonXxmxM=";
+          };
+          cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
+            inherit (final) pname src version;
+            hash = final.cargoHash;
+          };
+        }
+      );
+    in
+    with pkgs;
+    [
+      screen-message
+      qbittorrent
+      gajim
+      imv
+      mpv
+      evince
+      brightnessctl
+      pulsemixer
+      cmus
+      termusic
+      gsettings-desktop-schemas
+      xdg-utils
+      qt5.qtwayland
+      bashmount
+      audacity
+      spotify-player
+      zathura
+      ncdu
+      adwaita-icon-theme
+      bluetui
+      gammastep
+      graphicsmagick
+      i3status-rust
+      impala
+      kanshi
+      pamixer
+      swayidle
+      swaylock
+      wl-clipboard
+      xfce.thunar
+      banana-cursor
+      fuzzel
+      alacritty
+      i3bar-river
+      mako
+      swww
+      oculante
+      xwayland-satellite-git
+    ];
 
   # Enable sound.
   security.rtkit.enable = true;