From 7097778c22d60de89799b6d1549b242486a129c2 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Thu, 6 Aug 2026 22:11:57 -0400 Subject: [PATCH] Update Hyprland integration --- modules/desktop/hyprland/default.nix | 5 +++- modules/desktop/hyprland/overlay.nix | 19 ++++++++----- .../desktop/hyprland/plugins/hyprfocus.nix | 27 +++++-------------- .../desktop/hyprland/plugins/hyprsplit.nix | 2 +- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/modules/desktop/hyprland/default.nix b/modules/desktop/hyprland/default.nix index b604066..12786da 100644 --- a/modules/desktop/hyprland/default.nix +++ b/modules/desktop/hyprland/default.nix @@ -1,6 +1,6 @@ {self, ...}: { flake-file.inputs = { - hyprland.url = "github:hyprwm/Hyprland?ref=v0.55.4"; + hyprland.url = "github:hyprwm/Hyprland?ref=v0.56.2"; hylix = { url = "tarball+https://tangled.org/adam0.dev/hylix/archive/main?format=tar.gz"; @@ -54,6 +54,9 @@ wayland.windowManager.hyprland = { enable = true; + # UWSM manages the graphical session target. + systemd.enable = false; + # Packages are null because its installed sytem wide. package = null; portalPackage = null; diff --git a/modules/desktop/hyprland/overlay.nix b/modules/desktop/hyprland/overlay.nix index ff2fdfd..0501777 100644 --- a/modules/desktop/hyprland/overlay.nix +++ b/modules/desktop/hyprland/overlay.nix @@ -3,12 +3,17 @@ inherit (final.stdenv.hostPlatform) system; packages = inputs.hyprland.packages.${system}; in { - inherit - (packages) - # keep-sorted start - hyprland - xdg-desktop-portal-hyprland - # keep-sorted end - ; + inherit (packages) xdg-desktop-portal-hyprland; + + # TODO(upstream): Remove after updating past Hyprland 0.56.2. + # Accept Glaze 8 as supported by upstream Hyprland. + hyprland = packages.hyprland.overrideAttrs (oldAttrs: { + postPatch = + oldAttrs.postPatch + + '' + substituteInPlace CMakeLists.txt \ + --replace-fail "find_package(glaze 7...<8 QUIET)" "find_package(glaze QUIET)" + ''; + }); }; } diff --git a/modules/desktop/hyprland/plugins/hyprfocus.nix b/modules/desktop/hyprland/plugins/hyprfocus.nix index 57e8888..1cb420f 100644 --- a/modules/desktop/hyprland/plugins/hyprfocus.nix +++ b/modules/desktop/hyprland/plugins/hyprfocus.nix @@ -7,10 +7,14 @@ }; flake.modules.homeManager.hyprlandHyprfocusPlugin = { + # keep-sorted start lib, pkgs, + # keep-sorted end ... }: let + inherit (lib) escapeRegex; + hyprfocus = pkgs.hyprlandPlugins.hyprfocus; in { wayland.windowManager.hyprland.plugins = [hyprfocus]; @@ -18,7 +22,7 @@ programs.hylix = { permissions = [ { - binary = lib.escapeRegex "${hyprfocus}/lib/libhyprfocus.so"; + binary = escapeRegex "${hyprfocus}/lib/libhyprfocus.so"; mode = "allow"; type = "plugin"; } @@ -34,26 +38,9 @@ }; }; - flake.overlays.hyprland-plugins = final: prev: let - inherit (final.stdenv.hostPlatform) system; - - hyprfocus = inputs.hyprland-plugins.packages.${system}.hyprfocus.overrideAttrs (old: { - postPatch = - (old.postPatch or "") - + '' - substituteInPlace main.cpp \ - --replace-fail '#include ' '#include ' \ - --replace-fail '#include ' "" \ - --replace-fail '#include ' "" \ - --replace-fail 'Desktop::windowState()->windows()' 'g_pCompositor->m_windows' \ - --replace-fail 'Fullscreen::controller()->isFullscreen(w.lock())' 'w->isFullscreen()' \ - --replace-fail 'positionAnimation()' 'm_realPosition' \ - --replace-fail 'sizeAnimation()' 'm_realSize' - ''; - }); - in { + flake.overlays.hyprland-plugins = final: prev: { hyprlandPlugins = prev.hyprlandPlugins - // {inherit hyprfocus;}; + // {hyprfocus = final.callPackage "${inputs.hyprland-plugins}/hyprfocus" {};}; }; } diff --git a/modules/desktop/hyprland/plugins/hyprsplit.nix b/modules/desktop/hyprland/plugins/hyprsplit.nix index 6bc9591..47211f2 100644 --- a/modules/desktop/hyprland/plugins/hyprsplit.nix +++ b/modules/desktop/hyprland/plugins/hyprsplit.nix @@ -6,7 +6,7 @@ }: { programs.hylix._generatedConfig = lib.mkOrder 899 '' -- Expose hyprsplit for keybind dispatchers. - hyprsplit = dofile("${pkgs.nur.repos.adam0.hyprsplit}/init.lua") + hyprsplit = dofile("${pkgs.nur.repos.adam0.hyprlandPlugins.hyprsplit}/init.lua") hyprsplit.config({ num_workspaces = 8 }) ''; }; -- 2.51.2