home-profile: changes to zsh and wezterm

This commit is contained in:
Mateusz Słodkowicz 2024-03-31 23:07:50 +02:00
parent b925022a9e
commit eceae11a41
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
3 changed files with 26 additions and 10 deletions

View File

@ -53,6 +53,11 @@ in
example = "p10k";
default = "p10k";
};
options.materus.profile.zsh.endConfig = lib.mkOption {
default = "";
description = "Zsh config after all of config";
type = lib.types.lines;
};
config = lib.mkIf cfg.enable {
@ -62,9 +67,7 @@ in
home.file = lib.mkMerge [
(builtins.foldl' (a: b: a // b) { } (builtins.map (plugin: { ${plugin.path}.source = plugin.src; }) (builtins.attrValues extraPlugins)))
{ "${relToDotDir ".zshrc"}".text = lib.mkAfter ''
${lib.optionalString config.programs.wezterm.enable "source \"${config.programs.wezterm.package}/etc/profile.d/wezterm.sh\""}
''; }
{ "${relToDotDir ".zshrc"}".text = lib.mkAfter cfg.endConfig; }
];
programs.zsh = {

View File

@ -1,16 +1,22 @@
{ config, lib, materusArg, pkgs, ... }:
let
cfg = config.materus.profile.wezterm;
zshCfg = ''
source "${config.programs.wezterm.package}/etc/profile.d/wezterm.sh"
alias 'wezcraft'="wezterm --config font=\"wezterm.font 'Monocraft 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.enableWezcraft = materusArg.pkgs.lib.mkBoolOpt true "Enable alias to start wezcraft with monocraft font";
options.materus.profile.wezterm.extraConfig = lib.mkOption {
default = "";
description = "Config for wezterm";
type = lib.types.lines;
};
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable
{
programs.wezterm.enable = true;
programs.wezterm.colorSchemes = { };
programs.wezterm.extraConfig = ''
@ -18,11 +24,19 @@ in
package.path = package.path .. ";${materusArg.cfg.path}/extraFiles/config/wezterm/?.lua"
require("wezterm_config");
local config = materus_wezterm_config();
${lib.optionalString cfg.enableHackFont "config.font = wezterm.font 'Hack Nerd Font';"}
${cfg.extraConfig}
return config;
'';
home.packages = lib.mkIf cfg.enableHackFont [ (pkgs.nerdfonts.override { fonts = [ "Hack" ]; }) ];
home.packages = [
(lib.mkIf cfg.enableHackFont (pkgs.nerdfonts.override {
fonts = [ "Hack" ];
}))
(lib.mkIf cfg.enableWezcraft (pkgs.monocraft))
];
materus.profile.zsh.endConfig = lib.optionalString cfg.enableWezcraft zshCfg;
};
}

View File

@ -5,6 +5,5 @@ function materus_wezterm_config()
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