diff --git a/configurations/profile/home/terminal/wezterm.nix b/configurations/profile/home/terminal/wezterm.nix index 515eb7f..540df42 100644 --- a/configurations/profile/home/terminal/wezterm.nix +++ b/configurations/profile/home/terminal/wezterm.nix @@ -1,17 +1,12 @@ { config, lib, materusArg, pkgs, ... }: let cfg = config.materus.profile.wezterm; - cfgText = '' - config.hide_tab_bar_if_only_one_tab = true; - config.enable_scroll_bar = true; - config.font = wezterm.font 'Hack Nerd Font'; - ''; in { options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus wezterm config"; options.materus.profile.wezterm.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm"; - options.materus.profile.wezterm.config = lib.mkOption { - default = cfgText; + options.materus.profile.wezterm.extraConfig = lib.mkOption { + default = ""; description = "Config for wezterm"; type = lib.types.string; }; @@ -19,9 +14,11 @@ in programs.wezterm.enable = true; programs.wezterm.colorSchemes = { }; programs.wezterm.extraConfig = '' - local config = wezterm.config_builder(); - ${cfgText} + package.path = package.path .. ";${materusArg.cfg.path}/extraFiles/config/wezterm/?.lua" + require("wezterm_config"); + local config = materus_wezterm_config(); + ${cfg.extraConfig} return config; ''; diff --git a/extraFiles/config/wezterm/wezterm_config.lua b/extraFiles/config/wezterm/wezterm_config.lua new file mode 100644 index 0000000..2697d6e --- /dev/null +++ b/extraFiles/config/wezterm/wezterm_config.lua @@ -0,0 +1,10 @@ +local wezterm_config = {}; + +function materus_wezterm_config() + local wezterm = require 'wezterm'; + local cfg = wezterm.config_builder(); + cfg.hide_tab_bar_if_only_one_tab = true; + cfg.enable_scroll_bar = true; + cfg.font = wezterm.font 'Hack Nerd Font'; + return cfg; +end