home-profile: move wezterm config to own file

This commit is contained in:
Mateusz Słodkowicz 2024-03-31 22:28:57 +02:00
parent 369ed384a4
commit a1eccd4d77
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
2 changed files with 16 additions and 9 deletions

View File

@ -1,17 +1,12 @@
{ config, lib, materusArg, pkgs, ... }: { config, lib, materusArg, pkgs, ... }:
let let
cfg = config.materus.profile.wezterm; 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 in
{ {
options.materus.profile.wezterm.enable = materusArg.pkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable materus wezterm config"; 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.enableHackFont = materusArg.pkgs.lib.mkBoolOpt true "Enable hack nerd font for wezterm";
options.materus.profile.wezterm.config = lib.mkOption { options.materus.profile.wezterm.extraConfig = lib.mkOption {
default = cfgText; default = "";
description = "Config for wezterm"; description = "Config for wezterm";
type = lib.types.string; type = lib.types.string;
}; };
@ -19,9 +14,11 @@ in
programs.wezterm.enable = true; programs.wezterm.enable = true;
programs.wezterm.colorSchemes = { }; programs.wezterm.colorSchemes = { };
programs.wezterm.extraConfig = '' 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; return config;
''; '';

View File

@ -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