aboutsummaryrefslogtreecommitdiff
path: root/modules/terminal/system/programs/broot.nix
blob: ec20605a55978a2fa6462e0ade944c62b6cd5492 (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
{
  pkgs,
  config,
  lib,
  ...
}: let
  cfg = config.collinux.terminal.shells.fish;

  conf = {
    verbs = [
      {
        name = "open-code";
        key = "enter";
        execution = "$EDITOR +{line} {file}";
        working_dir = "{root}";
        leave_broot = true;
      }
    ];
  };
in
  lib.mkIf cfg.enable {
    hjem.users."${config.collinux.user.name}" = {
      files = {
        ".config/broot/conf.toml" = {
          generator = (pkgs.formats.toml {}).generate "conf.toml";
          value = conf;
        };

        ".config/fish/conf.d/broot.fish".text = lib.mkIf config.collinux.terminal.shells.fish.enable ''
          ${pkgs.broot}/bin/broot --print-shell-function fish | source
        '';
      };

      packages = [pkgs.broot];
    };
  }