From 630f07d6e0b98bcff2829a0d565df94d5bd7fd36 Mon Sep 17 00:00:00 2001 From: BrockoliniMorgan Date: Wed, 21 Oct 2026 00:40:39 +1000 Subject: [PATCH] hyprland: add withUWSM This allows to toggle the uwsm support without disabling systemd support (on nixos without uwsm for example) Reasoning: I wanted to stop my display manager from trying to suggest hyprland-with-uwsm instead of hyprland --- nixos/modules/programs/wayland/hyprland.nix | 1 + pkgs/by-name/hy/hyprland/package.nix | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/wayland/hyprland.nix b/nixos/modules/programs/wayland/hyprland.nix index cd041ad85f91..398cc74189f1 100644 --- a/nixos/modules/programs/wayland/hyprland.nix +++ b/nixos/modules/programs/wayland/hyprland.nix @@ -30,6 +30,7 @@ in p: wayland-lib.genFinalPackage p { enableXWayland = cfg.xwayland.enable; + withUWSM = cfg.withUWSM; }; }; diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index a1c5fb42d94f..bdb4625052fb 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -53,8 +53,10 @@ debug ? false, enableXWayland ? true, withSystemd ? lib.meta.availableOn gcc16Stdenv.hostPlatform systemdLibs, + withUWSM ? withSystemd, wrapRuntimeDeps ? true, }: +assert withUWSM -> withSystemd; let inherit (builtins) foldl' @@ -111,6 +113,8 @@ customStdenv.mkDerivation (finalAttrs: { --replace-fail "@PREFIX@/" "" substituteInPlace example/hyprland.desktop.in \ --replace-fail "@PREFIX@/" "" + '' + + lib.optionalString withUWSM '' substituteInPlace systemd/hyprland-uwsm.desktop \ --replace-fail "Exec=uwsm " "Exec=${lib.getExe uwsm} " \ --replace-fail "TryExec=uwsm" "TryExec=${lib.getExe uwsm}" @@ -204,7 +208,7 @@ customStdenv.mkDerivation (finalAttrs: { "NO_XWAYLAND" = !enableXWayland; "NO_SYSTEMD" = !withSystemd; "CMAKE_DISABLE_PRECOMPILE_HEADERS" = true; - "NO_UWSM" = !withSystemd; + "NO_UWSM" = !withUWSM; "TRACY_ENABLE" = false; }; @@ -223,7 +227,7 @@ customStdenv.mkDerivation (finalAttrs: { ''; passthru = { - providedSessions = [ "hyprland" ] ++ optionals withSystemd [ "hyprland-uwsm" ]; + providedSessions = [ "hyprland" ] ++ optionals withUWSM [ "hyprland-uwsm" ]; updateScript = ./update.sh; };