about summary refs log tree commit diff
path: root/modules/common/alacritty.nix
blob: 142f6c5409aa6e9f4ed8755e438dd78b54048977 (plain) (blame)
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
{
  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";
        };
        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;};
          cursor = {
            text = "CellBackground";
            cursor = "CellForeground";
          };
          vi_mode_cursor = {
            text = "CellBackground";
            cursor = "CellForeground";
          };
          search = {
            matches = {
              foreground = white;
              background = red;
            };
            focused_match = {
              foreground = red;
              background = black;
            };
            footer_bar = {
              foreground = black;
              background = white;
            };
          };
          hints = {
            start = {
              foreground = black;
              background = yellow;
            };
            end = {
              foreground = yellow;
              background = black;
            };
            line_indicator = {
              foreground = null;
              background = null;
            };
            selection = {
              text = "CellBackground";
              background = "CellForeground";
            };
            normal = {
              inherit black red green yellow blue magenta cyan white;
            };
            bright = {
              inherit
                brightBlack
                brightRed
                brightGreen
                brightYellow
                brightBlue
                brightMagenta
                brightCyan
                brightWhite
                ;
            };
          };
        };
        bell = {
          duration = 0;
          command = null; # TODO notify-send?
        };
        cursor = {
          style = {
            shape = "Block";
            blinking = "Off";
          };
          vi_mode_style = "Block";
        };
        selection.save_to_clipboard = true; # TODO autocutsel?
      };
    };
  };
}

Consider giving Nix/NixOS a try! <3