summaryrefslogtreecommitdiff
path: root/hm/shell/foot.nix
blob: 1a864747c3eb419434ede866751009d3f6626c8d (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
{
  pkgs,
  lib,
  config,
  ...
}:

let
  cfg = config.hm.shell.foot;

  footTheme = pkgs.fetchurl {
    url = "https://codeberg.org/dnkl/foot/raw/branch/master/themes/gruvbox-dark";
    sha256 = "sha256-hlmLklG/vAEDy8I+k13+o4ZR6Cq6lTxOconjf9M75eo=";
  };
in
{
  options.hm.shell.foot = {
    enable = lib.mkEnableOption "foot terminal emulator";
    fontSize = lib.mkOption {
      type = lib.types.int;
      default = 13;
      description = "Font size for the foot terminal";
    };
  };

  config = lib.mkIf cfg.enable {
    programs.foot = {
      enable = true;
      server.enable = true;
      settings = {
        main = {
          font = "JetBrainsMonoNFM-Regular:size=${toString cfg.fontSize}";
          include = "${footTheme}";
          word-delimiters = ",│`|:\"'()[]{}<>./";
          selection-target = "both";
          dpi-aware = "yes";
        };

        search-bindings = {
          find-prev = "Control+p";
          find-next = "Control+n";
          commit = "Return";
        };

        scrollback = {
          lines = 10000;
          multiplier = 3.0;
          indicator-position = "none";
        };

        security.osc52 = "enabled";
        url.osc8-underline = "always";
      };
    };
  };
}