aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/lf/default.nix
blob: ab5863974e931b1f5e0cdf7c37df9182cad3d555 (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
{
  pkgs,
  lib,
  config,
  ...
}:

# lf - terminal file manager
{
  options.tools.lf = {
    enable = lib.mkEnableOption "Enables lf.";
  };

  config = lib.mkIf config.tools.lf.enable {
    home.packages = with pkgs; [
      ctpv
    ];

    programs.lf = {
      enable = true;
      settings = {
        number = true;
        icons = true;
        drawbox = true;
        hidden = true;
        preview = true;
      };

      previewer = {
        source = lib.getExe' pkgs.ctpv "ctpv";
      };

      extraConfig = ''
        &${lib.getExe' pkgs.ctpv "ctpv"} -s $id
        cmd on-quit %${lib.getExe' pkgs.ctpv "ctpv"} -e $id
        set cleaner ${lib.getExe' pkgs.ctpv "ctpvclear"}
      '';
    };

    home.file.".config/lf/icons".source = ./icons;
  };
}