Files
nixos-config/modules/user/yazi.nix
T

72 lines
1.5 KiB
Nix
Raw Normal View History

2024-09-27 23:08:25 +03:00
{ pkgs, lib, ... }: let
yazi-plugins = pkgs.fetchFromGitHub {
owner = "yazi-rs";
repo = "plugins";
2025-07-22 10:16:26 +03:00
rev = "e95c7b384e7b0a9793fe1471f0f8f7810ef2a7ed";
hash = "sha256-TUS+yXxBOt6tL/zz10k4ezot8IgVg0/2BbS8wPs9KcE=";
2025-02-08 18:38:55 +03:00
};
starship = pkgs.fetchFromGitHub {
owner = "Rolv-Apneseth";
repo = "starship.yazi";
2025-07-22 10:16:26 +03:00
rev = "a63550b2f91f0553cc545fd8081a03810bc41bc0";
sha256 = "sha256-PYeR6fiWDbUMpJbTFSkM57FzmCbsB4W4IXXe25wLncg=";
2024-09-27 23:08:25 +03:00
};
in {
programs.yazi = {
enable = true;
enableZshIntegration = true;
shellWrapperName = "y";
settings = {
2025-06-08 02:46:53 +03:00
mgr = {
2024-09-27 23:08:25 +03:00
show_hidden = true;
};
preview = {
max_width = 1000;
max_height = 1000;
};
2025-06-26 19:50:54 +03:00
plugin = {
preloaders = [
{ name = "*.crdownload"; run = "noop"; }
];
};
2024-09-27 23:08:25 +03:00
};
plugins = {
chmod = "${yazi-plugins}/chmod.yazi";
full-border = "${yazi-plugins}/full-border.yazi";
max-preview = "${yazi-plugins}/max-preview.yazi";
2025-02-08 18:38:55 +03:00
starship = starship;
2024-09-27 23:08:25 +03:00
};
initLua = ''
require("full-border"):setup()
require("starship"):setup()
'';
keymap = {
2025-06-08 02:46:53 +03:00
mgr.prepend_keymap = [
2024-09-27 23:08:25 +03:00
{
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";
}
2024-12-17 22:27:15 +03:00
{
on = [ "<C-n>" ];
run = ''shell '${lib.getExe pkgs.xdragon} -x -i -T "$@"' --confirm'';
}
2025-03-29 15:04:24 +03:00
{
on = [ "g" "<S-d>" ];
run = ''cd /mnt/D'';
desc = "Goto D drive";
}
2024-09-27 23:08:25 +03:00
];
};
};
}