aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/modules/workstation/ui/kitty/default.nix
blob: dcfaadf3427d68b37fe7ac782e2be7104768bfeb (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/** 
 * A home-manager configuration module for the kitty terminal
 *
 * TODO: This module should probably just be merged into the
 * home-manager module, which does _most_ of this already. That way
 * I won't have to maintain this personally :)
 */

{ config, lib, pkgs, home-manager, ... } @ args:

let cfg = config.libkookie.ui.kitty;
in
with lib;
{
  options.libkookie.ui.kitty = {
    enable = mkEnableOption "kitty terminal configuration";

    extraFonts = mkOption {
      type = with types; listOf package;
      default = [ pkgs.twemoji-color-font ];
      description = ''
        Specify a set of extra fonts provided to the kitty configuration.
        
        By default ktty will use the standard monospace font specified
        on your system (via the libkookie.fonts module), but to enable
        emoji rendering (or ligatures?) you can specify additional
        fonts here.
      '';
    };

    term = mkOption {
      type = types.str;
      default = "xterm-256color";
      description = ''
        Specify what $TERM variable will be set.

        The default is chosen to allow backwards compatibility with
        existing systems.  You can set this varibale to `xterm-kitty`
        to enable kitty specific features in applications.  This may
        cause problems with legacy applications and remote systems!
      '';
    };

    cursorShape = mkOption {
      type = types.str;
      default = "block";
      description = ''
        Specify the shape of the cursor used for kitty.
      '';
    };

    fontSize = mkOption {
      type = types.int;
      default = 12;
      description = ''
        Set the font size to use in kitty.  This will generate a 
        `font_size` expression.
      '';
    };
    
    colors = mkOption {
      type = types.attrs;
      default = {
        selection_foreground = "#93a1a1";
        selection_background = "#073642";
        active_border_color = "#00ff00";
        inactive_border_color = "#cccccc";
        cursor = "#ffffff";
        
        foreground = "#c5c8c6";
        background = "#1d1f21";
        
        # black
        color0 = "#1d1f21";
        color8 = "#969896";

        # red
        color1 = "#cc6666";
        color9 = "#cc6666";

        # green
        color2  = "#b5bd68";
        color10 = "#b5bd68";

        # yellow
        color3  = "#f0c674";
        color11 = "#f0c674";

        # blue
        color4  = "#81a2be";
        color12 = "#81a2be";

        # magenta
        color5  = "#b294bb";
        color13 = "#b294bb";

        # cyan
        color6  = "#8abeb7";
        color14 = "#8abeb7";

        # white
        color7  = "#c5c8c6";
        color15 = "#ffffff";
      };

      description = ''
        Specify the set of colours used to render text in the
        terminal, as well as the standard foreground, background,
        selection, and border colours.

        The default colours are based on the solarized dark theme.
      '';
    };
  };

  config = mkIf cfg.enable (import ./setup.nix args);
}