cleanup, modularise
This commit is contained in:
21
modules/home/programs/terminal/ghostty.nix
Normal file
21
modules/home/programs/terminal/ghostty.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.terminal.ghostty;
|
||||
in {
|
||||
options = {
|
||||
terminal.ghostty.enable = mkEnableOption "enable ghostty terminal";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.ghostty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
gtk-single-instance = true;
|
||||
window-decoration = "client";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
24
modules/home/programs/terminal/kitty.nix
Normal file
24
modules/home/programs/terminal/kitty.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.terminal.kitty;
|
||||
in {
|
||||
options = {
|
||||
terminal.kitty.enable =
|
||||
mkEnableOption "enable kitty terminal";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
tab_bar_edge = "bottom";
|
||||
tab_bar_align = "left";
|
||||
tab_bar_style = "fade";
|
||||
# tab_separator = " ";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
modules/home/programs/terminal/main.nix
Normal file
7
modules/home/programs/terminal/main.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./kitty.nix
|
||||
./ghostty.nix
|
||||
./wezterm.nix
|
||||
];
|
||||
}
|
90
modules/home/programs/terminal/wezterm.nix
Normal file
90
modules/home/programs/terminal/wezterm.nix
Normal file
@ -0,0 +1,90 @@
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.terminal.wezterm;
|
||||
in {
|
||||
options = {
|
||||
terminal.wezterm.enable =
|
||||
mkEnableOption "enable wez's terminal";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
package = inputs.wezterm.packages.${pkgs.system}.default;
|
||||
extraConfig = ''
|
||||
local wezterm = require 'wezterm'
|
||||
local act = wezterm.action
|
||||
return {
|
||||
front_end = 'WebGpu',
|
||||
unix_domains = {
|
||||
{
|
||||
name = 'unix',
|
||||
},
|
||||
},
|
||||
enable_kitty_graphics = true,
|
||||
window_padding = {
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
},
|
||||
use_fancy_tab_bar = false,
|
||||
inactive_pane_hsb = {
|
||||
saturation = 0.8,
|
||||
brightness = 0.7,
|
||||
},
|
||||
-- window_frame = {
|
||||
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
|
||||
-- },
|
||||
disable_default_key_bindings = true,
|
||||
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
|
||||
keys = {
|
||||
{ key = 'n', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
|
||||
{ key = 'e', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down', },
|
||||
{ key = 'u', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up', },
|
||||
{ key = 'i', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
|
||||
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
|
||||
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
|
||||
{ key = '+', mods = 'SHIFT|CTRL', action = act.IncreaseFontSize },
|
||||
{ key = '-', mods = 'SHIFT|CTRL', action = act.DecreaseFontSize },
|
||||
{ key = '0', mods = 'SHIFT|CTRL', action = act.ResetFontSize },
|
||||
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
|
||||
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
|
||||
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
|
||||
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
|
||||
{ key = 'PageUp', mods = 'CTRL', action = act.ActivateTabRelative(-1) },
|
||||
{ key = 'PageDown', mods = 'CTRL', action = act.ActivateTabRelative(1) },
|
||||
{ key = 'LeftArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Left' },
|
||||
{ key = 'RightArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Right' },
|
||||
{ key = 'UpArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Up' },
|
||||
{ key = 'DownArrow', mods = 'CTRL', action = act.ActivatePaneDirection 'Down' },
|
||||
{ key = ',', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
|
||||
{ key = '.', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
|
||||
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
|
||||
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
|
||||
{ key = 'n', mods = 'CTRL', action = act.ActivatePaneDirection 'Left', },
|
||||
{ key = 'i', mods = 'CTRL', action = act.ActivatePaneDirection 'Right', },
|
||||
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
|
||||
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
|
||||
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
|
||||
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
|
||||
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
|
||||
{ key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
|
||||
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
|
||||
{
|
||||
act.ClearScrollback 'ScrollbackAndViewport',
|
||||
act.SendKey { key = 'L', mods = 'CTRL' },
|
||||
},
|
||||
},
|
||||
{ key = 'r', mods = 'LEADER', action = act.ActivateKeyTable { name = 'resize_pane', one_shot = false, }, }
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user