feat(hyprland): migrate home configs to lua configType
- Switch from hyprlang (hyprland.conf) to lua (hyprland.lua) config format
- Use configType = "lua" explicitly for clarity
- Replace exec-once with on = { _args = [...] } hook for startup commands
- Convert windowrule strings to window_rule attribute-set syntax with
mkLuaInline match objects and option sets per Home Manager module
- Change mkIf guard from config.desktop.wm.hyprland.enable to
config.wayland.windowManager.hyprland.enable (correct option path)
- Preserve all existing host-specific monitor layouts and window rules
- Both configs: m3-ares (eDP-1 + HDMI) and m3-kratos (DP-1 + DP-2)
- Run alejandra after changes; parse validation passes (exit 0)
Refs:
- https://github.com/nix-community/home-manager/blob/master/modules/services/window-managers/hyprland.nix
- https://wiki.hypr.land/Configuring/Start/
This commit is contained in:
+75
-11
@@ -37,15 +37,31 @@ with lib; {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ── Hyprland monitor layout ──
|
# ── Hyprland monitor layout ──
|
||||||
(mkIf config.desktop.wm.hyprland.enable {
|
(mkIf config.wayland.windowManager.hyprland.enable {
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
configType = "lua";
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
exec-once = ["tuxedo-backlight"];
|
# Startup commands
|
||||||
|
on = {
|
||||||
|
_args = [
|
||||||
|
"hyprland.start"
|
||||||
|
(lib.generators.mkLuaInline ''
|
||||||
|
function()
|
||||||
|
hl.exec_cmd("tuxedo-backlight")
|
||||||
|
end
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Monitor configuration
|
||||||
monitor = [
|
monitor = [
|
||||||
"eDP-1,preferred,0x0,1.25"
|
"eDP-1,preferred,0x0,1.25"
|
||||||
"HDMI-A-1,1920x1080@120,2560x0,1"
|
"HDMI-A-1,1920x1080@120,2560x0,1"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Workspace assignment
|
||||||
workspace = [
|
workspace = [
|
||||||
"1, monitor:eDP-1, default:true"
|
"1, monitor:eDP-1, default:true"
|
||||||
"2, monitor:eDP-1"
|
"2, monitor:eDP-1"
|
||||||
@@ -54,15 +70,63 @@ with lib; {
|
|||||||
"5, monitor:HDMI-A-1,border:false,rounding:false"
|
"5, monitor:HDMI-A-1,border:false,rounding:false"
|
||||||
"6, monitor:HDMI-A-1"
|
"6, monitor:HDMI-A-1"
|
||||||
];
|
];
|
||||||
windowrule = [
|
|
||||||
"match:class dev.zed.Zed, workspace 1"
|
# Window rules using attribute-set syntax (match + options)
|
||||||
"match:class Msty, workspace 1"
|
window_rule = [
|
||||||
"match:class ^(com.obsproject.Studio)$, workspace 2"
|
{
|
||||||
"match:class ^(brave-browser)$, workspace 4, opacity 1.0"
|
_args = [
|
||||||
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0"
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
|
||||||
"match:class ^steam_app_\\d+$, fullscreen on"
|
{workspace = 1;}
|
||||||
"match:class ^steam_app_\\d+$, workspace 5"
|
];
|
||||||
"match:class ^steam_app_\\d+$, idle_inhibit focus"
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
|
||||||
|
{workspace = 1;}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
|
||||||
|
{workspace = 2;}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.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;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
|
||||||
|
{fullscreen = "on";}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_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";}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,14 +37,19 @@ with lib; {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# ── Hyprland monitor layout ──
|
# ── Hyprland monitor layout ──
|
||||||
(mkIf config.desktop.wm.hyprland.enable {
|
(mkIf config.wayland.windowManager.hyprland.enable {
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
configType = "lua";
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
# Monitor configuration (dual 2560x1440@144 via DisplayPort)
|
||||||
monitor = [
|
monitor = [
|
||||||
"DP-1,2560x1440@144,0x0,1"
|
"DP-1,2560x1440@144,0x0,1"
|
||||||
"DP-2,2560x1440@144,2560x0,1"
|
"DP-2,2560x1440@144,2560x0,1"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Workspace assignment
|
||||||
workspace = [
|
workspace = [
|
||||||
"1, monitor:DP-1, default:true"
|
"1, monitor:DP-1, default:true"
|
||||||
"2, monitor:DP-1"
|
"2, monitor:DP-1"
|
||||||
@@ -54,13 +59,51 @@ with lib; {
|
|||||||
"6, monitor:DP-2"
|
"6, monitor:DP-2"
|
||||||
"7, monitor:DP-2"
|
"7, monitor:DP-2"
|
||||||
];
|
];
|
||||||
windowrule = [
|
|
||||||
"match:class dev.zed.Zed, workspace 1"
|
# Window rules using attribute-set syntax (match + options)
|
||||||
"match:class Msty, workspace 1"
|
window_rule = [
|
||||||
"match:class ^(com.obsproject.Studio)$, workspace 2"
|
{
|
||||||
"match:class ^(brave-browser)$, workspace 4, opacity 1.0"
|
_args = [
|
||||||
"match:class ^(vivaldi-stable)$, workspace 4, opacity 1.0"
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
|
||||||
"match:class ^steam_app_\\d+$, idle_inhibit focus"
|
{workspace = 1;}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
|
||||||
|
{workspace = 1;}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
|
||||||
|
{workspace = 2;}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.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;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
_args = [
|
||||||
|
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
|
||||||
|
{idle_inhibit = "focus";}
|
||||||
|
];
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user