Add ranger (terminal filemgr)

This commit is contained in:
ItsDrike 2024-04-05 01:26:38 +02:00
parent c5296ed6f8
commit 5aab80e92d
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
2 changed files with 26 additions and 0 deletions

View file

@ -7,6 +7,7 @@ _: {
./yazi ./yazi
./xplr ./xplr
./vifm ./vifm
./ranger.nix
]; ];
} }

View file

@ -0,0 +1,25 @@
{
pkgs,
lib,
osConfig,
config,
...
}: let
device = osConfig.modules.device;
# TODO: maybe not have a TUI file manager on desktops, when GUI does it better
acceptedTypes = ["laptop" "desktop" "hybrid" "server" "lite"];
inherit (lib.strings) optionalString;
in {
config = lib.mkIf (builtins.elem device.type acceptedTypes) {
home.packages = with pkgs; [
ranger
];
# TODO: more file preview methods
xdg.configFile."ranger/rc.conf".text = ''
set preview_images true
${(optionalString config.programs.kitty.enable "set preview_images_method kitty")}
'';
};
}