fix(theme): generate per-palette kitty.conf + ghostty.conf

features/apps/kitty/config/kitty.conf:1 contains
  include ~/.config/nomarchy/current/theme/kitty.conf
and features/apps/ghostty/config/config:2 contains
  config-file = ?"~/.config/nomarchy/current/theme/ghostty.conf"

Neither file existed for any of the 22 palettes. The kitty include
failed silently and the ghostty include is optional (?-prefix), so both
terminals rendered with built-in default colors regardless of the
active Nomarchy theme.

Stylix has kitty.enable = true in themes/engine/stylix.nix but the
kitty module uses xdg.configFile rather than programs.kitty, so the
Stylix target had nothing to hook into. ghostty has no Stylix target at
all.

Generated both files from the active palette's base16 colors in
themes/engine/files.nix, mirroring the waybar.css pattern already there.
Color mapping reproduces the original colors.toml fields (background,
foreground, cursor, selection_*, color0..15) via base16 indices —
verified against the inverse mapping in themes/palettes/default.nix.

themes/palettes/summer-day/apps/kitty/kitty.conf (a 76KB stray file in
the wrong tree location) is unaffected by this fix — it was already
dead surface since the include path never resolved to it.
This commit is contained in:
Bernardo Magri
2026-05-21 20:26:13 +01:00
parent 0486e037df
commit 8d3ce2d841

View File

@@ -33,6 +33,62 @@ in
@define-color accent #${palette.base0D};
'';
# Per-palette kitty colors. features/apps/kitty/config/kitty.conf includes
# this file; without it the include silently failed and kitty stayed on
# default colors for every palette (Stylix's kitty target only kicks in
# when programs.kitty.enable is set, which the module doesn't use).
xdg.configFile."nomarchy/current/theme/kitty.conf".text = ''
background #${palette.base00}
foreground #${palette.base05}
cursor #${palette.base05}
selection_background #${palette.base02}
selection_foreground #${palette.base05}
color0 #${palette.base01}
color1 #${palette.base08}
color2 #${palette.base0B}
color3 #${palette.base0A}
color4 #${palette.base0D}
color5 #${palette.base0E}
color6 #${palette.base0C}
color7 #${palette.base04}
color8 #${palette.base03}
color9 #${palette.base08}
color10 #${palette.base0B}
color11 #${palette.base0A}
color12 #${palette.base0D}
color13 #${palette.base0E}
color14 #${palette.base0C}
color15 #${palette.base07}
'';
# Per-palette ghostty colors. features/apps/ghostty/config/config uses an
# optional include (?-prefix) of this file; without it the include was
# silently skipped and ghostty rendered with its built-in defaults across
# every palette. ghostty has no Stylix target.
xdg.configFile."nomarchy/current/theme/ghostty.conf".text = ''
background = ${palette.base00}
foreground = ${palette.base05}
cursor-color = ${palette.base05}
selection-background = ${palette.base02}
selection-foreground = ${palette.base05}
palette = 0=#${palette.base01}
palette = 1=#${palette.base08}
palette = 2=#${palette.base0B}
palette = 3=#${palette.base0A}
palette = 4=#${palette.base0D}
palette = 5=#${palette.base0E}
palette = 6=#${palette.base0C}
palette = 7=#${palette.base04}
palette = 8=#${palette.base03}
palette = 9=#${palette.base08}
palette = 10=#${palette.base0B}
palette = 11=#${palette.base0A}
palette = 12=#${palette.base0D}
palette = 13=#${palette.base0E}
palette = 14=#${palette.base0C}
palette = 15=#${palette.base07}
'';
# Ensure theme-specific hyprland config exists
# Lookup priority: palette apps/ > feature themes/ > nord fallback
xdg.configFile."nomarchy/current/theme/apps/hyprland.conf" = lib.mkIf (!hasHyprlandConf) {