2022-08-08 03:18:10 +00:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.programs.wezterm;
|
2023-06-24 02:26:56 +00:00
|
|
|
|
|
|
|
shellIntegration = ''
|
|
|
|
source ${pkgs.bash-preexec}/share/bash/bash-preexec.sh
|
|
|
|
source ${cfg.package}/etc/profile.d/wezterm.sh
|
|
|
|
'';
|
2022-11-19 03:05:31 +00:00
|
|
|
in
|
|
|
|
{
|
2022-08-08 03:18:10 +00:00
|
|
|
options.programs.wezterm = {
|
|
|
|
enable = lib.mkEnableOption "Wezterm terminal emulator";
|
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
|
|
|
default = pkgs.wezterm;
|
|
|
|
description = "Package containing <command>wezterm</command> binary.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
|
|
|
|
# This is needed for shell integration and applying semantic zones.
|
2023-06-29 04:30:03 +00:00
|
|
|
programs.bash.interactiveShellInit = shellIntegration;
|
|
|
|
programs.zsh.interactiveShellInit = shellIntegration;
|
2022-08-08 03:18:10 +00:00
|
|
|
};
|
|
|
|
}
|