/ home / modules / ghostty.nix
ghostty.nix
 1  {
 2    lib,
 3    config,
 4    ...
 5  }:
 6  with lib;
 7  let
 8    cfg = config.maatwerk.ghostty;
 9  in
10  {
11    options.maatwerk.ghostty = {
12      enable = mkEnableOption "Terminal emulator";
13    };
14    config = mkIf cfg.enable {
15      programs.ghostty = {
16        enable = true;
17        enableZshIntegration = true;
18        clearDefaultKeybinds = true;
19        systemd.enable = true;
20  
21        settings = {
22          gtk-tabs-location = "bottom";
23          gtk-toolbar-style = "flat";
24          gtk-titlebar-hide-when-maximized = true;
25          scrollback-limit = 500 * 1024 * 1024; # 500mb
26          freetype-load-flags = "no-force-autohint";
27          shell-integration-features = "ssh-env";
28          keybind = [
29            "ctrl+shift+page_down=move_tab:1"
30            "ctrl+shift+page_up=move_tab:-1"
31            "ctrl+shift+c=copy_to_clipboard"
32            "ctrl+shift+v=paste_from_clipboard"
33            "ctrl+shift+r=prompt_surface_title"
34            "ctrl+shift+f=write_scrollback_file:paste"
35            "ctrl+shift+a=select_all"
36            "ctrl+page_down=next_tab"
37            "ctrl+page_up=previous_tab"
38            "ctrl+shift+t=new_tab"
39            "ctrl+shift+w=close_tab:this"
40            "ctrl+9=decrease_font_size:1"
41            "ctrl+0=increase_font_size:1"
42          ];
43        };
44      };
45    };
46  }