From 6c26ade62100c58447502e7e13d86fd467aa611d Mon Sep 17 00:00:00 2001 From: m3tm3re Date: Mon, 18 May 2026 19:07:42 +0200 Subject: [PATCH] fix(hyprland): remove enable override, use workspace_rule and table-based window_rule syntax - Remove redundant `enable = true` from host hyprland blocks to avoid circular module reference (Hyprland is already enabled via m3ta-home profile flags; these files only add host-specific settings) - Replace legacy string-format `workspace = ["1, monitor:..."]` entries with proper `workspace_rule` attrsets (e.g. `{ workspace = "1"; monitor = "DP-1"; default = true; }`) per current Hyprland Lua docs - Replace `_args + mkLuaInline hl.dsp.window.match(...)` window_rule pattern with clean single-table `{ match.class = "..."; effect; }` attrsets per Home Manager module examples - Keep `configType = "lua"` and monitor table syntax unchanged --- hosts/m3-ares/home.nix | 113 ++++++++++++++++----------------------- hosts/m3-kratos/home.nix | 93 ++++++++++++++++---------------- 2 files changed, 92 insertions(+), 114 deletions(-) diff --git a/hosts/m3-ares/home.nix b/hosts/m3-ares/home.nix index c82ba1c..c79711e 100644 --- a/hosts/m3-ares/home.nix +++ b/hosts/m3-ares/home.nix @@ -39,11 +39,10 @@ with lib; { # ── Hyprland monitor layout ── (mkIf config.wayland.windowManager.hyprland.enable { wayland.windowManager.hyprland = { - enable = true; configType = "lua"; settings = { - # Startup commands (using on hook for Lua config) + # Startup commands — hl.on() for Lua config on = { _args = [ "hyprland.start" @@ -55,8 +54,7 @@ with lib; { ]; }; - # Monitor configuration — use Lua table syntax hl.monitor({...}) - # Each list entry generates one hl.monitor(...) call. + # Monitor configuration: each list entry → hl.monitor({...}) monitor = [ { _args = [ @@ -80,87 +78,66 @@ with lib; { } ]; - # Simple workspace→monitor bindings (legacy string format OK for hl.workspace) - workspace = [ - "1, monitor:eDP-1, default:true" - "2, monitor:eDP-1" - "3, monitor:eDP-1" - "4, monitor:HDMI-A-1" - "6, monitor:HDMI-A-1" - ]; - - # Workspace rules with special properties → use workspace_rule + Lua table + # Workspace rules → hl.workspace_rule({ workspace, monitor, default, ... }) workspace_rule = [ { - _args = [ - { - workspace = "5"; - monitor = "HDMI-A-1"; - no_border = true; - no_rounding = true; - } - ]; + workspace = "1"; + monitor = "eDP-1"; + default = true; + } + { + workspace = "2"; + monitor = "eDP-1"; + } + { + workspace = "3"; + monitor = "eDP-1"; + } + { + workspace = "4"; + monitor = "HDMI-A-1"; + } + { + workspace = "5"; + monitor = "HDMI-A-1"; + no_border = true; + no_rounding = true; + } + { + workspace = "6"; + monitor = "HDMI-A-1"; } ]; - # Window rules — match + effect fields as Lua table - # Per Hyprland Lua docs: match fields (class, title, etc.) and - # effect fields (workspace, fullscreen, opacity, etc.) together - # in one table passed to hl.window_rule({...}). + # Window rules → hl.window_rule({ match = { class = "..." }, effect, ... }) window_rule = [ { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'') - {workspace = "1";} - ]; + match.class = "dev.zed.Zed"; + workspace = "1"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'') - {workspace = "1";} - ]; + match.class = "Msty"; + workspace = "1"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'') - {workspace = "2";} - ]; + match.class = "com\\.obsproject\\.Studio"; + workspace = "2"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'') - { - workspace = "4"; - opacity = "1.0"; - } - ]; + match.class = "brave-browser"; + workspace = "4"; + opacity = "1.0"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'') - { - workspace = "4"; - opacity = "1.0"; - } - ]; + match.class = "vivaldi-stable"; + workspace = "4"; + opacity = "1.0"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'') - {fullscreen = true;} - ]; - } - { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'') - {workspace = "5";} - ]; - } - { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'') - {idle_inhibit = "focus";} - ]; + match.class = "steam_app_\\d+"; + fullscreen = true; + workspace = "5"; + idle_inhibit = "focus"; } ]; }; diff --git a/hosts/m3-kratos/home.nix b/hosts/m3-kratos/home.nix index 06109b9..d8b67ee 100644 --- a/hosts/m3-kratos/home.nix +++ b/hosts/m3-kratos/home.nix @@ -39,12 +39,10 @@ with lib; { # ── Hyprland monitor layout ── (mkIf config.wayland.windowManager.hyprland.enable { wayland.windowManager.hyprland = { - enable = true; configType = "lua"; settings = { - # Monitor configuration — use Lua table syntax hl.monitor({...}) - # Each list entry generates one hl.monitor(...) call. + # Monitor configuration: each list entry → hl.monitor({...}) monitor = [ { _args = [ @@ -68,63 +66,66 @@ with lib; { } ]; - # Simple workspace→monitor bindings (legacy string format OK for hl.workspace) - workspace = [ - "1, monitor:DP-1, default:true" - "2, monitor:DP-1" - "3, monitor:DP-1" - "4, monitor:DP-2" - "5, monitor:DP-2" - "6, monitor:DP-2" - "7, monitor:DP-2" + # Workspace rules → hl.workspace_rule({ workspace, monitor, default, ... }) + workspace_rule = [ + { + workspace = "1"; + monitor = "DP-1"; + default = true; + } + { + workspace = "2"; + monitor = "DP-1"; + } + { + workspace = "3"; + monitor = "DP-1"; + } + { + workspace = "4"; + monitor = "DP-2"; + } + { + workspace = "5"; + monitor = "DP-2"; + } + { + workspace = "6"; + monitor = "DP-2"; + } + { + workspace = "7"; + monitor = "DP-2"; + } ]; - # Window rules — match + effect fields as Lua table - # Per Hyprland Lua docs: match fields (class, title, etc.) and - # effect fields (workspace, fullscreen, opacity, etc.) together - # in one table passed to hl.window_rule({...}). + # Window rules → hl.window_rule({ match = { class = "..." }, effect, ... }) window_rule = [ { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'') - {workspace = "1";} - ]; + match.class = "dev.zed.Zed"; + workspace = "1"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'') - {workspace = "1";} - ]; + match.class = "Msty"; + workspace = "1"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'') - {workspace = "2";} - ]; + match.class = "com\\.obsproject\\.Studio"; + workspace = "2"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'') - { - workspace = "4"; - opacity = "1.0"; - } - ]; + match.class = "brave-browser"; + workspace = "4"; + opacity = "1.0"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'') - { - workspace = "4"; - opacity = "1.0"; - } - ]; + match.class = "vivaldi-stable"; + workspace = "4"; + opacity = "1.0"; } { - _args = [ - (lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'') - {idle_inhibit = "focus";} - ]; + match.class = "steam_app_\\d+"; + idle_inhibit = "focus"; } ]; };