blob: 2fab9978ec884833f009ddb4e3c9f13138512a8a (
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
|
{ config, pkgs, lib, ... }:
{
options.tools.file-manager.lf = {
enable = lib.mkEnableOption "Enables lf.";
};
config = lib.mkIf config.tools.file-manager.lf.enable {
tools.file-manager.default = lib.mkDefault "lf";
tools.file-manager.command =
lib.mkIf
(config.tools.file-manager.default == "lf")
"${pkgs.lf}/bin/lf";
programs.lf.enable = true;
programs.lf.settings = {
hidden = true;
};
programs.lf.previewer.source = pkgs.writeShellScript
"previewer.sh"
''
#!/bin/sh
unset COLORTERM
${if config.tools.viewer.bat.enable then
"bat -pp --line-range=:500 --color=always"
else "cat"} "$1"
'';
programs.lf.extraConfig = "set icons";
xdg.configFile."lf/icons".source = ./icons;
};
}
|