home-profile: changes to zsh and wezterm
This commit is contained in:
parent
b925022a9e
commit
eceae11a41
|
@ -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 = {
|
||||
|
|
|
@ -1,28 +1,42 @@
|
|||
{ 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 {
|
||||
programs.wezterm.enable = true;
|
||||
programs.wezterm.colorSchemes = { };
|
||||
programs.wezterm.extraConfig = ''
|
||||
config = lib.mkIf cfg.enable
|
||||
{
|
||||
programs.wezterm.enable = true;
|
||||
programs.wezterm.colorSchemes = { };
|
||||
programs.wezterm.extraConfig = ''
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue