aboutsummaryrefslogtreecommitdiffstats
path: root/modules/terminal/kitty/default.nix
blob: 7e4c7018f7284e303c4284077ccc91065d74cf95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# GPU-accelerated terminal emulator
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.terminal.kitty;
in
{
  imports = [
    ./colors.nix
    ./keybindings.nix
  ];

  options.terminal.kitty = {
    enable = lib.mkEnableOption "Enables kitty.";
    package = lib.mkOption {
      type = lib.types.package;
      readOnly = true;
      default = config.programs.kitty.package;
      description = "The kitty package to use.";
    };
  };

  config = lib.mkIf cfg.enable {
    xdg.mimeApps.defaultApplications = {
      "x-scheme-handler/terminal" = "kitty.desktop";
    };

    programs.kitty = {
      enable = true;
      extraConfig = builtins.readFile ./kitty.conf;
      settings = {
        window_padding_width = 10;
        font_size = config.fonts.size;
        font_family = config.fonts.normal;
        filter_notification = "all";
        update_check_interval = 0;
        scrollbar_indicator_opacity = "0.5";
        dynamic_background_opacity = false;
        enable_audio_bell = false;
        allow_remote_control = "no";
        shell = lib.mkIf config.terminal.zsh.enable (lib.getExe config.terminal.zsh.package);
      };
    };
  };
}