Terminals, tmux and Emacs share a grayscale palette with amber accents instead of Dracula, and the desktop bars and menus use a matching gray background.
106 lines
2.6 KiB
Nix
106 lines
2.6 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
enabled = config.mod.wezterm.enable;
|
|
|
|
hyprlandEnabled = config.mod.hyprland.enable;
|
|
|
|
colors = config.lib.colors.terminal;
|
|
luaList = list: "{ " + lib.concatMapStringsSep ", " (c: "'#${c}'") list + " }";
|
|
in
|
|
{
|
|
options = {
|
|
mod.wezterm = {
|
|
enable = lib.mkEnableOption "enable wezterm module";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
home-manager.users.alex = lib.mkIf enabled {
|
|
programs.wezterm = {
|
|
enable = true;
|
|
|
|
extraConfig = ''
|
|
-- Pull in the wezterm API
|
|
local wezterm = require 'wezterm'
|
|
|
|
local config = wezterm.config_builder()
|
|
|
|
config.colors = {
|
|
foreground = '#${colors.foreground}',
|
|
background = '#${colors.background}',
|
|
cursor_bg = '#${colors.cursor}',
|
|
cursor_border = '#${colors.cursor}',
|
|
cursor_fg = '#${colors.background}',
|
|
selection_bg = '#${colors.selection}',
|
|
selection_fg = '#${colors.foreground}',
|
|
ansi = ${luaList colors.regular},
|
|
brights = ${luaList colors.bright},
|
|
}
|
|
|
|
config.font = wezterm.font 'JetBrainsMono Nerd Font'
|
|
-- to get "perfect" scaling to the right
|
|
config.font_size = 15.2
|
|
|
|
config.enable_tab_bar = false
|
|
|
|
config.window_padding = {
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
}
|
|
|
|
config.disable_default_key_bindings = true
|
|
config.keys = {
|
|
{
|
|
key = 'C',
|
|
mods = 'CTRL|SHIFT',
|
|
action = wezterm.action.CopyTo "Clipboard",
|
|
},
|
|
{
|
|
key = 'V',
|
|
mods = 'CTRL|SHIFT',
|
|
action = wezterm.action.PasteFrom "Clipboard",
|
|
},
|
|
{
|
|
key = '+',
|
|
mods = 'CTRL',
|
|
action = wezterm.action.IncreaseFontSize,
|
|
},
|
|
{
|
|
key = '-',
|
|
mods = 'CTRL',
|
|
action = wezterm.action.DecreaseFontSize,
|
|
},
|
|
{
|
|
key = '0',
|
|
mods = 'CTRL',
|
|
action = wezterm.action.ResetFontSize,
|
|
},
|
|
}
|
|
|
|
return config
|
|
'';
|
|
};
|
|
|
|
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
|
settings = {
|
|
bind = [
|
|
{
|
|
_args = [
|
|
"SUPER + RETURN"
|
|
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.wezterm}/bin/wezterm")'')
|
|
];
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|