wezterm: add integrations for Bash and Zsh (#3934)

* wezterm: Add `enableBashIntegration` option

* wezterm: Add `enableZshIntegration` option
This commit is contained in:
Olmo Kramer 2023-06-05 22:46:18 +02:00 committed by GitHub
parent 607d8fad96
commit 24d590cc32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 118 additions and 0 deletions

View file

@ -7,6 +7,10 @@ let
cfg = config.programs.wezterm;
tomlFormat = pkgs.formats.toml { };
shellIntegrationStr = ''
source "${cfg.package}/etc/profile.d/wezterm.sh"
'';
in {
meta.maintainers = [ hm.maintainers.blmhemu ];
@ -79,6 +83,13 @@ in {
'';
};
enableBashIntegration = mkEnableOption "WezTerm's Bash integration." // {
default = true;
};
enableZshIntegration = mkEnableOption "WezTerm's Zsh integration." // {
default = true;
};
};
config = mkIf cfg.enable {
@ -99,5 +110,9 @@ in {
nameValuePair "wezterm/colors/${name}.toml" {
source = tomlFormat.generate "${name}.toml" { colors = value; };
}) cfg.colorSchemes;
programs.bash.initExtra =
mkIf cfg.enableBashIntegration shellIntegrationStr;
programs.zsh.initExtra = mkIf cfg.enableZshIntegration shellIntegrationStr;
};
}