From 826569ed9852e84f18f233a40e3c9611ddcce3bb Mon Sep 17 00:00:00 2001 From: m3ta-chiron Date: Mon, 18 May 2026 17:27:15 +0200 Subject: [PATCH] feat: migrate host Hyprland configs to Lua (Hyprland 0.55+) - m3-kratos/home.nix: use hl.monitor({}), hl.workspace_rule({}), hl.window_rule({}) table-based Lua API - m3-ares/home.nix: same Lua API + tuxedo-backlight via hl.on() - Update flake.lock: home-manager -> 74f170c6 (2026-05-18) --- flake.lock | 6 +++--- hosts/m3-ares/home.nix | 44 ++++++++++++++++++++++------------------ hosts/m3-kratos/home.nix | 37 +++++++++++++++++---------------- 3 files changed, 46 insertions(+), 41 deletions(-) diff --git a/flake.lock b/flake.lock index 4f96b71..39ce788 100644 --- a/flake.lock +++ b/flake.lock @@ -448,11 +448,11 @@ ] }, "locked": { - "lastModified": 1778248595, - "narHash": "sha256-dhFgEjoeJMYN/7OY6xfxS799YB4IjbbYXTjyGIJyLpc=", + "lastModified": 1779113444, + "narHash": "sha256-/L61sT1PIKmGWIQpIh0uJGH/ANvcsf6y4alxtb9kelg=", "owner": "nix-community", "repo": "home-manager", - "rev": "fdb2ccba9d5e1238d32e0c4a3ec1a277efa80c1d", + "rev": "74f170c62d57f90e656841f1f699e6bdf40f0a24", "type": "github" }, "original": { diff --git a/hosts/m3-ares/home.nix b/hosts/m3-ares/home.nix index 9bac583..5610fbc 100644 --- a/hosts/m3-ares/home.nix +++ b/hosts/m3-ares/home.nix @@ -36,35 +36,39 @@ with lib; { }; } - # ── Hyprland monitor layout ── + # ── Hyprland monitor layout & host-specific rules ── (mkIf config.desktop.wm.hyprland.enable { wayland.windowManager.hyprland = { enable = true; settings = { - exec-once = ["tuxedo-backlight"]; + # Laptop internal + external HDMI monitor = [ - "eDP-1,preferred,0x0,1.25" - "HDMI-A-1,1920x1080@120,2560x0,1" + { output = "eDP-1"; mode = "preferred"; position = "0x0"; scale = 1.25; } + { output = "HDMI-A-1"; mode = "1920x1080@120"; position = "2560x0"; scale = 1; } ]; - workspace = [ - "1, monitor:eDP-1, default:true" - "2, monitor:eDP-1" - "3, monitor:eDP-1" - "4, monitor:HDMI-A-1" - "5, monitor:HDMI-A-1,border:false,rounding:false" - "6, monitor:HDMI-A-1" + workspace_rule = [ + { 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"; border = false; rounding = false; } + { workspace = 6; monitor = "HDMI-A-1"; } ]; - windowrule = [ - "match:class dev.zed.Zed, workspace 1" - "match:class Msty, workspace 1" - "match:class ^(com.obsproject.Studio)$, workspace 2" - "match:class ^(brave-browser)$, workspace 4, opacity 1.0" - "match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0" - "match:class ^steam_app_\\d+$, fullscreen on" - "match:class ^steam_app_\\d+$, workspace 5" - "match:class ^steam_app_\\d+$, idle_inhibit focus" + window_rule = [ + { match = { class = "dev.zed.Zed" }; workspace = "1"; } + { match = { class = "Msty" }; workspace = "1"; } + { match = { class = "^com.obsproject.Studio$" }; workspace = "2"; } + { match = { class = "^(brave-browser)$" }; workspace = "4"; opacity = 1.0; } + { match = { class = "^(vivaldi-stable)$" }; workspace = "4"; opacity = 1.0; } + { match = { class = "^steam_app_\\d+$" }; fullscreen = true; workspace = "5"; idle_inhibit = "focus"; } ]; }; + extraConfig = mkAfter '' + -- Host startup: TUXEDO backlight + hl.on("hyprland.start", function() + hl.exec_cmd("tuxedo-backlight") + end) + ''; }; }) ]; diff --git a/hosts/m3-kratos/home.nix b/hosts/m3-kratos/home.nix index d4f59a9..185bfc5 100644 --- a/hosts/m3-kratos/home.nix +++ b/hosts/m3-kratos/home.nix @@ -36,31 +36,32 @@ with lib; { }; } - # ── Hyprland monitor layout ── + # ── Hyprland monitor layout & host-specific rules ── (mkIf config.desktop.wm.hyprland.enable { wayland.windowManager.hyprland = { enable = true; settings = { + # Dual monitor: DP-1 left, DP-2 right monitor = [ - "DP-1,2560x1440@144,0x0,1" - "DP-2,2560x1440@144,2560x0,1" + { output = "DP-1"; mode = "2560x1440@144"; position = "0x0"; scale = 1; } + { output = "DP-2"; mode = "2560x1440@144"; position = "2560x0"; scale = 1; } ]; - 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_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"; } ]; - windowrule = [ - "match:class dev.zed.Zed, workspace 1" - "match:class Msty, workspace 1" - "match:class ^(com.obsproject.Studio)$, workspace 2" - "match:class ^(brave-browser)$, workspace 4, opacity 1.0" - "match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0" - "match:class ^steam_app_\\d+$, idle_inhibit focus" + window_rule = [ + { match = { class = "dev.zed.Zed" }; workspace = "1"; } + { match = { class = "Msty" }; workspace = "1"; } + { match = { class = "^com.obsproject.Studio$" }; workspace = "2"; } + { match = { class = "^(brave-browser)$" }; workspace = "4"; opacity = 1.0; } + { match = { class = "^(vivaldi-stable)$" }; workspace = "4"; opacity = 1.0; } + { match = { class = "^steam_app_\\d+$" }; idle_inhibit = "focus"; } ]; }; };