diff --git a/system/services/windowmanager/hyprland/default.nix b/system/services/windowmanager/hyprland/default.nix index 458894ab..fbbe6b34 100644 --- a/system/services/windowmanager/hyprland/default.nix +++ b/system/services/windowmanager/hyprland/default.nix @@ -8,12 +8,15 @@ ./hyprpaper.nix ./pyprland.nix ./xdg-portal.nix + ./xwayland.nix ]; - # enable hyprland - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${system}.hyprland; - portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; + programs = { + # enable hyprland + hyprland = { + enable = true; + package = inputs.hyprland.packages.${system}.hyprland; + portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; + }; }; } diff --git a/system/services/windowmanager/hyprland/xdg-portal.nix b/system/services/windowmanager/hyprland/xdg-portal.nix index 665b2393..6912bd9b 100644 --- a/system/services/windowmanager/hyprland/xdg-portal.nix +++ b/system/services/windowmanager/hyprland/xdg-portal.nix @@ -1,6 +1,7 @@ # Reference: # https://github.com/hyprwm/xdg-desktop-portal-hyprland # https://nixos.wiki/wiki/Sway +# https://search.nixos.org/options?channel=unstable&show=xdg.portal { pkgs, inputs, system, ... }: @@ -26,9 +27,8 @@ in # enable hyprland's xdg-desktop-portal xdg.portal = { enable = true; - # hyprland has its own portal, wlr is not needed - wlr.enable = false; - configPackages = [ pkgs-hypr.xdg-desktop-portal-hyprland ]; + # sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1 + xdgOpenUsePortal = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs-hypr.xdg-desktop-portal-hyprland diff --git a/system/services/windowmanager/hyprland/xwayland.nix b/system/services/windowmanager/hyprland/xwayland.nix new file mode 100644 index 00000000..7fa24cfc --- /dev/null +++ b/system/services/windowmanager/hyprland/xwayland.nix @@ -0,0 +1,9 @@ +# Reference: +# https://stackoverflow.com/questions/77590918/not-able-to-share-entire-screen-on-discord-in-hyprland + +_: + +{ + # enable xwayland + programs.xwayland.enable = true; +} diff --git a/system/services/xdg-portal.nix b/system/services/xdg-portal.nix index fefc5af3..7cfc4169 100644 --- a/system/services/xdg-portal.nix +++ b/system/services/xdg-portal.nix @@ -1,4 +1,6 @@ -# Reference: https://nixos.wiki/wiki/Sway +# Reference: +# https://nixos.wiki/wiki/Sway +# https://search.nixos.org/options?channel=unstable&show=xdg.portal { pkgs, ... }: @@ -20,6 +22,8 @@ xdg.portal = { enable = true; + # sets environment variable NIXOS_XDG_OPEN_USE_PORTAL to 1 + xdgOpenUsePortal = true; # gtk portal needed to make gtk apps happy extraPortals = [ pkgs.xdg-desktop-portal-gtk