From bcec3c1b54e5518def4ad335a8ab5134f0f015eb Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 25 Dec 2025 16:51:57 +0200 Subject: [PATCH 1/4] nixos/uwsm: don't set sessionPackages if no waylandCompositors were defined --- nixos/modules/programs/wayland/uwsm.nix | 49 ++++++++++++++----------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/nixos/modules/programs/wayland/uwsm.nix b/nixos/modules/programs/wayland/uwsm.nix index ee61c2ebad3e..966264a3a0fd 100644 --- a/nixos/modules/programs/wayland/uwsm.nix +++ b/nixos/modules/programs/wayland/uwsm.nix @@ -110,30 +110,35 @@ in }; }; - config = lib.mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; - systemd.packages = [ cfg.package ]; - environment.pathsToLink = [ "/share/uwsm" ]; + config = lib.mkIf cfg.enable ( + lib.mkMerge [ + { + environment.systemPackages = [ cfg.package ]; + systemd.packages = [ cfg.package ]; + environment.pathsToLink = [ "/share/uwsm" ]; - # UWSM recommends dbus broker for better compatibility - services.dbus.implementation = "broker"; + # UWSM recommends dbus broker for better compatibility + services.dbus.implementation = "broker"; - services.displayManager = { - enable = true; - sessionPackages = lib.mapAttrsToList ( - name: value: - mk_uwsm_desktop_entry { - inherit name; - inherit (value) - prettyName - comment - binPath - extraArgs - ; - } - ) cfg.waylandCompositors; - }; - }; + services.displayManager.enable = true; + } + + (lib.mkIf cfg.waylandCompositors != {} { + services.displayManager.sessionPackages = lib.mapAttrsToList ( + name: value: + mk_uwsm_desktop_entry { + inherit name; + inherit (value) + prettyName + comment + binPath + extraArgs + ; + } + ) cfg.waylandCompositors; + }) + ] + ); meta.maintainers = with lib.maintainers; [ johnrtitor From d3613b164df4222ede2665201ed2cf2114e6d22c Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 25 Dec 2025 20:20:19 +0200 Subject: [PATCH 2/4] nixos/uwsm: set default for waylandCompositors --- nixos/modules/programs/wayland/uwsm.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/wayland/uwsm.nix b/nixos/modules/programs/wayland/uwsm.nix index 966264a3a0fd..112251143a30 100644 --- a/nixos/modules/programs/wayland/uwsm.nix +++ b/nixos/modules/programs/wayland/uwsm.nix @@ -107,6 +107,7 @@ in binPath = "/run/current-system/sw/bin/sway"; }; ''; + default = { }; }; }; @@ -123,7 +124,7 @@ in services.displayManager.enable = true; } - (lib.mkIf cfg.waylandCompositors != {} { + (lib.mkIf (cfg.waylandCompositors != { }) { services.displayManager.sessionPackages = lib.mapAttrsToList ( name: value: mk_uwsm_desktop_entry { From 9128dd3103ce1305cd8e2d4dde2f249608447b4c Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 25 Dec 2025 17:00:09 +0200 Subject: [PATCH 3/4] nixos/hyprland: don't set uwsm waylandCompositor --- nixos/modules/programs/wayland/hyprland.nix | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index ae9d224778c2..59ca38e173a4 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -89,6 +89,9 @@ in configPackages = lib.mkDefault [ cfg.package ]; }; + # To make the Hyprland session available in DM + services.displayManager.sessionPackages = [ cfg.package ]; + systemd = lib.mkIf cfg.systemd.setPath.enable { user.extraConfig = '' DefaultEnvironment="PATH=/run/wrappers/bin:/etc/profiles/per-user/%u/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:$PATH" @@ -98,18 +101,6 @@ in (lib.mkIf (cfg.withUWSM) { programs.uwsm.enable = true; - # Configure UWSM to launch Hyprland from a display manager like SDDM - programs.uwsm.waylandCompositors = { - hyprland = { - prettyName = "Hyprland"; - comment = "Hyprland compositor managed by UWSM"; - binPath = "/run/current-system/sw/bin/start-hyprland"; - }; - }; - }) - (lib.mkIf (!cfg.withUWSM) { - # To make a vanilla Hyprland session available in DM - services.displayManager.sessionPackages = [ cfg.package ]; }) (import ./wayland-session.nix { From 363918b16457f3f6accb76f7da3fc36758509788 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Wed, 7 Jan 2026 17:51:55 +0200 Subject: [PATCH 4/4] hyprland: install hyprland-uwsm.desktop when systemd is available --- pkgs/by-name/hy/hyprland/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index dfd0a3eae580..0dbc8b901d3e 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -194,7 +194,7 @@ customStdenv.mkDerivation (finalAttrs: { "NO_XWAYLAND" = !enableXWayland; "NO_SYSTEMD" = !withSystemd; "CMAKE_DISABLE_PRECOMPILE_HEADERS" = true; - "NO_UWSM" = true; + "NO_UWSM" = !withSystemd; "NO_HYPRPM" = true; "TRACY_ENABLE" = false; };