summaryrefslogtreecommitdiff
path: root/modules/common/alacritty.nix
blob: be3af214f2590e2616e4d5d5845d627050523691 (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
118
119
120
121
122
123
124
125
126
127
{
  config,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.alacritty;
in {
  options.nixfiles.modules.alacritty.enable =
    mkEnableOption "Alacritty terminal emulator";

  config = mkIf cfg.enable {
    hm.programs.alacritty = {
      enable = true;
      settings = with config.nixfiles.modules; {
        window = {
          padding = with config.fontScheme.monospaceFont; {
            x = size;
            y = size;
          };
          dynamic_padding = false;
          decorations = "Full";
          startup_mode = "Maximized";
        };
        font = with config.fontScheme.monospaceFont; {
          normal = {
            inherit family;
            style = "Regular";
          };
          bold = {
            inherit family;
            style = "Bold";
          };
          italic = {
            inherit family;
            style = "Italic";
          };
          bold_italic = {
            inherit family;
            style = "Bold Italic";
          };
          inherit size;
        };
        colors = with config.colourScheme; {
          primary = {
            inherit background foreground;
            dim_foreground = "None";
            bright_foreground = "None";
          };
          cursor = {
            text = "CellBackground";
            cursor = "CellForeground";
          };
          vi_mode_cursor = {
            text = "CellBackground";
            cursor = "CellForeground";
          };
          search = {
            matches = {
              foreground = white;
              background = red;
            };
            focused_match = {
              foreground = red;
              background = black;
            };
          };
          hints = {
            start = {
              foreground = black;
              background = yellow;
            };
            end = {
              foreground = yellow;
              background = black;
            };
          };
          line_indicator = {
            foreground = "None";
            background = "None";
          };
          footer_bar = {
            foreground = black;
            background = white;
          };
          selection = {
            text = "CellBackground";
            background = "CellForeground";
          };
          normal = {
            inherit
              black
              red
              green
              yellow
              blue
              magenta
              cyan
              white
              ;
          };
          bright = {
            black = brightBlack;
            red = brightRed;
            green = brightGreen;
            yellow = brightYellow;
            blue = brightBlue;
            magenta = brightMagenta;
            cyan = brightCyan;
            white = brightWhite;
          };
        };
        selection.save_to_clipboard = true;
        cursor = {
          style = {
            shape = "Block";
            blinking = "On";
          };
          vi_mode_style = {
            shape = "Block";
            blinking = "Off";
          };
        };
      };
    };
  };
}