hyprland: fix Lua config errors caused by stylix's Hyprland target
Stylix's Hyprland target injects settings.{general,decoration,group,misc}
as top-level keys. In hyprlang mode these render as section blocks, but
in Lua mode (configType = "lua") they become hl.general(), hl.decoration(),
etc. — functions that don't exist, causing an emergency-mode config error.
Disable stylix.targets.hyprland and absorb all its colours into
settings.config.{general,decoration,group,misc} where they are correctly
rendered inside the single hl.config({}) call.
Also add a home.activation script that removes any stale hyprland.conf
(auto-generated by Hyprland before hyprland.lua was first placed) so the
autogenerated-config warning banner can never persist across restarts.
Keep services.hyprpaper.enable = true since it was previously set by the
now-disabled Hyprland target.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
62a1f9a38c
commit
f4b45c8bda
1 changed files with 38 additions and 1 deletions
|
|
@ -94,7 +94,21 @@ in
|
||||||
polkit_gnome
|
polkit_gnome
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.fred = { config, lib, pkgs, inputs, ... }: {
|
home-manager.users.fred = { config, lib, pkgs, inputs, ... }:
|
||||||
|
let
|
||||||
|
c = config.lib.stylix.colors;
|
||||||
|
rgb = hex: "rgb(${hex})";
|
||||||
|
rgba = hex: a: "rgba(${hex}${a})";
|
||||||
|
in {
|
||||||
|
# Stylix's Hyprland target injects settings.{general,decoration,group,misc}
|
||||||
|
# as top-level keys, which render as hl.general()/hl.decoration()/… in Lua
|
||||||
|
# mode — functions that don't exist. Disable it and absorb the colours
|
||||||
|
# into settings.config below.
|
||||||
|
stylix.targets.hyprland.enable = false;
|
||||||
|
|
||||||
|
# Hyprpaper was previously started by stylix's Hyprland target; keep it.
|
||||||
|
services.hyprpaper.enable = true;
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configType = "lua";
|
configType = "lua";
|
||||||
|
|
@ -111,6 +125,8 @@ in
|
||||||
border_size = 2;
|
border_size = 2;
|
||||||
layout = "dwindle";
|
layout = "dwindle";
|
||||||
resize_on_border = true;
|
resize_on_border = true;
|
||||||
|
"col.active_border" = rgb c.base0D;
|
||||||
|
"col.inactive_border" = rgb c.base03;
|
||||||
};
|
};
|
||||||
|
|
||||||
decoration = {
|
decoration = {
|
||||||
|
|
@ -118,6 +134,18 @@ in
|
||||||
blur = {
|
blur = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
};
|
};
|
||||||
|
shadow.color = rgba c.base00 "99";
|
||||||
|
};
|
||||||
|
|
||||||
|
group = {
|
||||||
|
"col.border_active" = rgb c.base0D;
|
||||||
|
"col.border_inactive" = rgb c.base03;
|
||||||
|
"col.border_locked_active" = rgb c.base0C;
|
||||||
|
groupbar = {
|
||||||
|
text_color = rgb c.base05;
|
||||||
|
"col.active" = rgb c.base0D;
|
||||||
|
"col.inactive" = rgb c.base03;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
render = {
|
render = {
|
||||||
|
|
@ -157,6 +185,7 @@ in
|
||||||
# show as urgent in the bar instead.
|
# show as urgent in the bar instead.
|
||||||
focus_on_activate = false;
|
focus_on_activate = false;
|
||||||
vrr = 2;
|
vrr = 2;
|
||||||
|
background_color = rgb c.base00;
|
||||||
};
|
};
|
||||||
|
|
||||||
# vfr moved from misc: to debug: in 0.55.0
|
# vfr moved from misc: to debug: in 0.55.0
|
||||||
|
|
@ -560,6 +589,14 @@ in
|
||||||
#battery.critical { color: @base08; }
|
#battery.critical { color: @base08; }
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# The old hyprlang hyprland.conf (with `# autogenerated = 1`) is not
|
||||||
|
# managed by HM after switching to configType = "lua", so Hyprland still
|
||||||
|
# finds it and shows the "autogenerated config" banner. Remove it once on
|
||||||
|
# every activation so it can never linger.
|
||||||
|
home.activation.removeOldHyprlandConf = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
|
rm -f "${config.xdg.configHome}/hypr/hyprland.conf"
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue