feat(hyprland): update to Lua config syntax after flake update

Flake inputs updated (home-manager → 7519f615, nixpkgs → d2339023, etc.),
now configType = "lua" is supported.

Changes to Hyprland settings:
- monitor: replaced legacy comma-string format with Lua table syntax
  using _args + {output, mode, position, scale} for hl.monitor({...})
  calls. Home Manager now generates correct hl.monitor() calls instead
  of passing raw comma strings.
- workspace: kept simple "id, monitor:X, default:true" string format
  for basic monitor bindings (compatible with hl.workspace(...)).
- workspace_rule: added separate workspace_rule entries using
  _args + {workspace, monitor, no_border, no_rounding} for special
  cases (e.g. WS 5 border:false,rounding:false → no_border=true,
  no_rounding=true as per current Hyprland Lua docs).
- window_rule: updated workspace values from int to string ("1",
  "2", etc.), updated fullscreen from "on" to boolean true, kept
  opacity as string "1.0" per Hyprland docs, kept idle_inhibit as
  string "focus".
- on hook: kept as-is (hyprland.start + tuxedo-backlight).

Validate: nix-instantiate --parse passes for both host files.
This commit is contained in:
m3tm3re
2026-05-18 19:00:26 +02:00
parent 0d74e38ae7
commit 9bd6d38a95
3 changed files with 148 additions and 91 deletions
+51 -16
View File
@@ -43,7 +43,7 @@ with lib; {
configType = "lua";
settings = {
# Startup commands
# Startup commands (using on hook for Lua config)
on = {
_args = [
"hyprland.start"
@@ -55,48 +55,83 @@ with lib; {
];
};
# Monitor configuration
# Monitor configuration — use Lua table syntax hl.monitor({...})
# Each list entry generates one hl.monitor(...) call.
monitor = [
"eDP-1,preferred,0x0,1.25"
"HDMI-A-1,1920x1080@120,2560x0,1"
{
_args = [
{
output = "eDP-1";
mode = "preferred";
position = "0x0";
scale = 1.25;
}
];
}
{
_args = [
{
output = "HDMI-A-1";
mode = "1920x1080@120";
position = "2560x0";
scale = 1;
}
];
}
];
# Workspace assignment
# 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"
"5, monitor:HDMI-A-1,border:false,rounding:false"
"6, monitor:HDMI-A-1"
];
# Window rules using attribute-set syntax (match + options)
# Workspace rules with special properties → use workspace_rule + Lua table
workspace_rule = [
{
_args = [
{
workspace = "5";
monitor = "HDMI-A-1";
no_border = true;
no_rounding = true;
}
];
}
];
# 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_rule = [
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
{workspace = 1;}
{workspace = "1";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
{workspace = 1;}
{workspace = "1";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
{workspace = 2;}
{workspace = "2";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'')
{
workspace = 4;
opacity = 1.0;
workspace = "4";
opacity = "1.0";
}
];
}
@@ -104,21 +139,21 @@ with lib; {
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'')
{
workspace = 4;
opacity = 1.0;
workspace = "4";
opacity = "1.0";
}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
{fullscreen = "on";}
{fullscreen = true;}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "steam_app_\\d+" })'')
{workspace = 5;}
{workspace = "5";}
];
}
{
+34 -12
View File
@@ -43,13 +43,32 @@ with lib; {
configType = "lua";
settings = {
# Monitor configuration (dual 2560x1440@144 via DisplayPort)
# Monitor configuration — use Lua table syntax hl.monitor({...})
# Each list entry generates one hl.monitor(...) call.
monitor = [
"DP-1,2560x1440@144,0x0,1"
"DP-2,2560x1440@144,2560x0,1"
{
_args = [
{
output = "DP-1";
mode = "2560x1440@144";
position = "0x0";
scale = 1;
}
];
}
{
_args = [
{
output = "DP-2";
mode = "2560x1440@144";
position = "2560x0";
scale = 1;
}
];
}
];
# Workspace assignment
# Simple workspace→monitor bindings (legacy string format OK for hl.workspace)
workspace = [
"1, monitor:DP-1, default:true"
"2, monitor:DP-1"
@@ -60,32 +79,35 @@ with lib; {
"7, monitor:DP-2"
];
# Window rules using attribute-set syntax (match + options)
# 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_rule = [
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "dev.zed.Zed" })'')
{workspace = 1;}
{workspace = "1";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "Msty" })'')
{workspace = 1;}
{workspace = "1";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "com\\.obsproject\\.Studio" })'')
{workspace = 2;}
{workspace = "2";}
];
}
{
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "brave-browser" })'')
{
workspace = 4;
opacity = 1.0;
workspace = "4";
opacity = "1.0";
}
];
}
@@ -93,8 +115,8 @@ with lib; {
_args = [
(lib.generators.mkLuaInline ''hl.dsp.window.match({ class = "vivaldi-stable" })'')
{
workspace = 4;
opacity = 1.0;
workspace = "4";
opacity = "1.0";
}
];
}