From de0870f075737eac147c31fcef77df9b9525abfa Mon Sep 17 00:00:00 2001 From: "Adam M. Szalkowski" Date: Tue, 29 Apr 2025 17:37:43 +0200 Subject: [PATCH] wezterm: adapt for breaking change in hm (#1182) Link: https://github.com/danth/stylix/pull/1182 Reviewed-by: awwpotato Tested-by: https://github.com/NovaViper --- modules/wezterm/hm.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/modules/wezterm/hm.nix b/modules/wezterm/hm.nix index 89deb24e..c4aa0f83 100644 --- a/modules/wezterm/hm.nix +++ b/modules/wezterm/hm.nix @@ -77,12 +77,12 @@ -- Generated by Stylix local wezterm = require("wezterm") wezterm.add_to_config_reload_watch_list(wezterm.config_dir) - local function stylix_wrapped_config() - ${config.programs.wezterm.extraConfig} + -- Allow working with both the current release and the nightly + local config = {} + if wezterm.config_builder then + config = wezterm.config_builder() end - local stylix_base_config = wezterm.config_builder() - local stylix_user_config = stylix_wrapped_config() - stylix_base_config = { + local stylix_base_config = { color_scheme = "stylix", font = wezterm.font_with_fallback { "${fonts.monospace.name}", @@ -136,10 +136,19 @@ command_palette_fg_color = "${base05}", command_palette_font_size = ${builtins.toString fonts.sizes.popups}, } - for key, value in pairs(stylix_user_config) do - stylix_base_config[key] = value + for key, value in pairs(stylix_base_config) do + config[key] = value end - return stylix_base_config + local function stylix_wrapped_config() + ${config.programs.wezterm.extraConfig} + end + local stylix_user_config = stylix_wrapped_config() + if stylix_user_config then + for key, value in pairs(stylix_user_config) do + config[key] = value + end + end + return config ''; }; }