From 0b0b7cefcce7f67bd56e2903be34db579b22528a Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Thu, 30 May 2024 12:31:10 +0530 Subject: [PATCH 1/4] nixos/hyprland: disable wlr-portal for Hyprland This commit: - Adds wlr-portal override of wayland-session module (enabled by default) - Disable it for hyprland module --- nixos/modules/programs/wayland/hyprland.nix | 1 + nixos/modules/programs/wayland/wayland-session.nix | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index f5ca741f9432..1d6fe4f102cd 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -70,6 +70,7 @@ in (import ./wayland-session.nix { inherit lib pkgs; xwayland = cfg.xwayland.enable; + wlr-portal = false; # Hyprland has its own portal, wlr is not needed }) ]); diff --git a/nixos/modules/programs/wayland/wayland-session.nix b/nixos/modules/programs/wayland/wayland-session.nix index e9c12da156ab..094af8388c72 100644 --- a/nixos/modules/programs/wayland/wayland-session.nix +++ b/nixos/modules/programs/wayland/wayland-session.nix @@ -1,4 +1,9 @@ -{ lib, pkgs, xwayland ? true }: +{ + lib, + pkgs, + xwayland ? true, + wlr-portal ? true, +}: { security = { @@ -14,5 +19,5 @@ xwayland.enable = lib.mkDefault xwayland; }; - xdg.portal.wlr.enable = lib.mkDefault true; + xdg.portal.wlr.enable = wlr-portal; } From 98f9f9951aa9a2457fbaad18039bae477df0c32d Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Thu, 30 May 2024 14:25:36 +0530 Subject: [PATCH 2/4] nixos/hyprland: add fufexan as maintainer Per https://github.com/NixOS/nixpkgs/pull/315827#issuecomment-2139073465 --- nixos/modules/programs/wayland/hyprland.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index 1d6fe4f102cd..7e979f017c98 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -88,4 +88,6 @@ in "Nvidia patches are no longer needed" ) ]; + + meta.maintainers = with lib.maintainers; [ fufexan ]; } From 7b2a2824b39888364738c5fca848aa2508366110 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:30:19 +0530 Subject: [PATCH 3/4] nixos/wayland-session: force running xdg autostart for WM-only sessions --- nixos/modules/programs/wayland/wayland-session.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/modules/programs/wayland/wayland-session.nix b/nixos/modules/programs/wayland/wayland-session.nix index 094af8388c72..49b078d34a02 100644 --- a/nixos/modules/programs/wayland/wayland-session.nix +++ b/nixos/modules/programs/wayland/wayland-session.nix @@ -20,4 +20,8 @@ }; xdg.portal.wlr.enable = wlr-portal; + + # Window manager only sessions (unlike DEs) don't handle XDG + # autostart files, so force them to run the service + services.xserver.desktopManager.runXdgAutostartIfNone = lib.mkDefault true; } From de777188870259d3a1633a41dad963cc19bee6a1 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:27:17 +0530 Subject: [PATCH 4/4] nixos/wayland-session: cleanup xwayland, wlr-portal -> enable-xwayland, enable-wlr-portal --- nixos/modules/programs/wayland/hyprland.nix | 4 ++-- nixos/modules/programs/wayland/river.nix | 2 +- nixos/modules/programs/wayland/sway.nix | 2 +- nixos/modules/programs/wayland/wayland-session.nix | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index 7e979f017c98..98779ea7d03a 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -69,8 +69,8 @@ in (import ./wayland-session.nix { inherit lib pkgs; - xwayland = cfg.xwayland.enable; - wlr-portal = false; # Hyprland has its own portal, wlr is not needed + enableXWayland = cfg.xwayland.enable; + enableWlrPortal = false; # Hyprland has its own portal, wlr is not needed }) ]); diff --git a/nixos/modules/programs/wayland/river.nix b/nixos/modules/programs/wayland/river.nix index 0980bd28cf82..6391f00e2f62 100644 --- a/nixos/modules/programs/wayland/river.nix +++ b/nixos/modules/programs/wayland/river.nix @@ -57,7 +57,7 @@ in (import ./wayland-session.nix { inherit lib pkgs; - xwayland = cfg.xwayland.enable; + enableXWayland = cfg.xwayland.enable; }) ]); diff --git a/nixos/modules/programs/wayland/sway.nix b/nixos/modules/programs/wayland/sway.nix index 31821a84a5bd..e3e32aa7a56a 100644 --- a/nixos/modules/programs/wayland/sway.nix +++ b/nixos/modules/programs/wayland/sway.nix @@ -140,7 +140,7 @@ in (import ./wayland-session.nix { inherit lib pkgs; - xwayland = cfg.xwayland.enable; + enableXWayland = cfg.xwayland.enable; }) ]); diff --git a/nixos/modules/programs/wayland/wayland-session.nix b/nixos/modules/programs/wayland/wayland-session.nix index 49b078d34a02..877b10668470 100644 --- a/nixos/modules/programs/wayland/wayland-session.nix +++ b/nixos/modules/programs/wayland/wayland-session.nix @@ -1,8 +1,8 @@ { lib, pkgs, - xwayland ? true, - wlr-portal ? true, + enableXWayland ? true, + enableWlrPortal ? true, }: { @@ -16,10 +16,10 @@ programs = { dconf.enable = lib.mkDefault true; - xwayland.enable = lib.mkDefault xwayland; + xwayland.enable = lib.mkDefault enableXWayland; }; - xdg.portal.wlr.enable = wlr-portal; + xdg.portal.wlr.enable = enableWlrPortal; # Window manager only sessions (unlike DEs) don't handle XDG # autostart files, so force them to run the service