nix-dotfiles/modules/software/system/wezterm.nix

50 lines
1.3 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.software.system.wezterm;
in {
options.modules.software.system.wezterm = {
enable = mkEnableOption "Enable wezterm, a blazingly fast terminal emulator";
package = mkOption {
type = types.package;
default = pkgs.wezterm;
};
};
config = mkIf cfg.enable {
environment.variables.TERM = "wezterm";
hm.programs.wezterm = {
enable = true;
package = cfg.package;
extraConfig = let
fonts = config.modules.desktop.fonts.fonts;
in ''
local wezterm = require 'wezterm'
local config = {}
config.front_end = "WebGpu"
config.font = wezterm.font '${fonts.monospaceBitmap.family}'
config.font_size = ${toString fonts.monospaceBitmap.size}
config.freetype_load_flags = 'MONOCHROME'
config.enable_wayland = false
config.use_fancy_tab_bar = false
config.use_resize_increments = true
config.initial_cols = 120
config.initial_rows = 40
config.window_background_opacity = 0.8
${config.modules.desktop.themes.wezterm or ""}
config.window_frame = {
font = wezterm.font '${fonts.sansSerif.family}',
font_size = ${toString fonts.sansSerif.size}
}
return config
'';
};
};
}