nixos-config/modules/nixos/programs/wezterm.nix

29 lines
766 B
Nix
Raw Normal View History

2022-08-08 03:18:10 +00:00
{ config, options, lib, pkgs, ... }:
let
cfg = config.programs.wezterm;
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` binary.";
2022-08-08 03:18:10 +00:00
};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
# This is needed for shell integration and applying semantic zones.
programs.bash.interactiveShellInit = shellIntegration;
programs.zsh.interactiveShellInit = shellIntegration;
2022-08-08 03:18:10 +00:00
};
}