nixos-config/home-manager/modules/yazi.nix
2025-03-25 22:18:25 -04:00

62 lines
1.4 KiB
Nix

{ pkgs, ... }:
let
plugins-repo = pkgs.fetchFromGitHub {
owner = "yazi-rs";
repo = "plugins";
rev = "273019910c1111a388dd20e057606016f4bd0d17";
hash = "sha256-80mR86UWgD11XuzpVNn56fmGRkvj0af2cFaZkU8M31I=";
};
in
{
programs.yazi = {
enable = true;
enableZshIntegration = true;
shellWrapperName = "y";
settings = {
manager = {
show_hidden = true;
};
preview = {
max_width = 1000;
max_height = 1000;
};
};
plugins = {
chmod = "${plugins-repo}/chmod.yazi";
full-border = "${plugins-repo}/full-border.yazi";
max-preview = "${plugins-repo}/max-preview.yazi";
starship = pkgs.fetchFromGitHub {
owner = "Rolv-Apneseth";
repo = "starship.yazi";
rev = "6c639b474aabb17f5fecce18a4c97bf90b016512";
sha256 = "sha256-bhLUziCDnF4QDCyysRn7Az35RAy8ibZIVUzoPgyEO1A=";
};
};
initLua = ''
require("full-border"):setup()
require("starship"):setup()
'';
keymap = {
manager.prepend_keymap = [
{
on = "T";
run = "plugin sync max-preview";
desc = "Maximize or restore the preview pane";
}
{
on = [
"c"
"m"
];
run = "plugin chmod";
desc = "Chmod on selected files";
}
];
};
};
}