2025-04-04 15:38:54 -04:00
|
|
|
{ inputs, pkgs, lib, ... }:
|
2025-02-05 00:50:55 -05:00
|
|
|
{
|
2025-02-05 01:26:40 -05:00
|
|
|
programs.yazi = {
|
2025-02-05 00:50:55 -05:00
|
|
|
enable = true;
|
|
|
|
enableFishIntegration = true;
|
|
|
|
package = inputs.yazi.packages.x86_64-linux.default;
|
2025-03-21 16:50:54 -04:00
|
|
|
initLua = ./yazi/init.lua;
|
2025-04-04 15:38:54 -04:00
|
|
|
|
|
|
|
plugins = let
|
|
|
|
officialPluginsNames = [
|
|
|
|
"chmod"
|
|
|
|
"diff"
|
|
|
|
"smart-filter"
|
|
|
|
"git"
|
|
|
|
"mount"
|
|
|
|
];
|
|
|
|
|
|
|
|
officialPluginsSrc = pkgs.fetchgit {
|
|
|
|
url = "https://github.com/yazi-rs/plugins.git";
|
|
|
|
sparseCheckout = map (p: "${p}.yazi") officialPluginsNames;
|
|
|
|
rev = "HEAD";
|
|
|
|
hash = "sha256-3F44uFeFBX7PNXo2/maiAzkA/OfweyN4nbDhftna+CI=";
|
|
|
|
};
|
|
|
|
|
|
|
|
officialPlugins =
|
|
|
|
lib.lists.fold (
|
|
|
|
a: b:
|
|
|
|
{
|
|
|
|
${a} = "${officialPluginsSrc}/${a}.yazi";
|
|
|
|
}
|
|
|
|
// b
|
|
|
|
)
|
|
|
|
{}
|
|
|
|
officialPluginsNames;
|
|
|
|
in
|
|
|
|
officialPlugins // {
|
|
|
|
yatline = pkgs.fetchFromGitHub {
|
|
|
|
owner = "imsi32";
|
|
|
|
repo = "yatline.yazi";
|
|
|
|
rev = "HEAD";
|
|
|
|
sha256 = "sha256-JiUik4umi+ujsJmHliUbLsIj7ZTKayrWAAM8HmRdjwk=";
|
|
|
|
};
|
|
|
|
starship = pkgs.fetchFromGitHub {
|
|
|
|
owner = "Rolv-Apneseth";
|
|
|
|
repo = "starship.yazi";
|
|
|
|
rev = "HEAD";
|
|
|
|
sha256 = "sha256-bhLUziCDnF4QDCyysRn7Az35RAy8ibZIVUzoPgyEO1A=";
|
|
|
|
};
|
|
|
|
restore = pkgs.fetchFromGitHub {
|
|
|
|
owner = "boydaihungst";
|
|
|
|
repo = "restore.yazi";
|
|
|
|
rev = "HEAD";
|
|
|
|
sha256 = "sha256-OJJPgpSaUHYz8a9opVLCds+VZsK1B6T+pSRJyVgYNy8=";
|
|
|
|
};
|
|
|
|
lazygit = pkgs.fetchFromGitHub {
|
|
|
|
owner = "Lil-Dank";
|
|
|
|
repo = "lazygit.yazi";
|
|
|
|
rev = "HEAD";
|
|
|
|
sha256 = "sha256-OJJPgpSaUHYz8a9opVLCds+VZsK1B6T+pSRJyVgYNy8=";
|
|
|
|
};
|
|
|
|
ouch = pkgs.fetchFromGitHub {
|
|
|
|
owner = "ndtoan96";
|
|
|
|
repo = "ouch.yazi";
|
|
|
|
rev = "HEAD";
|
|
|
|
sha256 = "sha256-7X8uAiJ8vBXYBXOgyKhVVikOnTBGrdCcXOJemjQNolI=";
|
|
|
|
};
|
|
|
|
dir-rules = ./yazi/plugins/dir-rules.yazi;
|
|
|
|
smart-tab = ./yazi/plugins/smart-tab.yazi;
|
|
|
|
};
|
|
|
|
|
2025-02-05 00:50:55 -05:00
|
|
|
keymap = {
|
2025-02-06 18:58:39 -05:00
|
|
|
manager.prepend_keymap = [
|
2025-02-26 22:18:59 -05:00
|
|
|
{ on = "!"; run = "shell '$SHELL' --block"; desc = "Open shell here"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = ["c" "d"]; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; desc = "Drag selection";}
|
|
|
|
{ on = ["c" "c"]; run = "yank"; desc = "Copy file"; }
|
2025-02-05 00:50:55 -05:00
|
|
|
{ on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; desc = "Go to top of git repo"; }
|
|
|
|
{ on = ["g" "p"]; run = "cd ~/Projects"; desc = "Go to ~/Projects"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
|
|
|
{ on = ["g" "l"]; run = "plugin lazygit"; desc = "lazygit"; }
|
|
|
|
|
2025-02-06 18:58:39 -05:00
|
|
|
{ on = ["t" "p"]; run = "plugin toggle-view parent"; desc = "Toggle parent"; }
|
|
|
|
{ on = ["t" "c"]; run = "plugin toggle-view current"; desc = "Toggle current"; }
|
|
|
|
{ on = ["t" "r"]; run = "plugin toggle-view preview"; desc = "Toggle preview"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-06 18:58:39 -05:00
|
|
|
{ on = "<C-t>"; run ="tab_create"; }
|
|
|
|
{ on = "<C-w>"; run ="tab_close"; }
|
|
|
|
{ on = "<C-A-right>"; run ="tab_switch 1 --relative"; }
|
|
|
|
{ on = "<C-A-left>"; run ="tab_switch -1 --relative"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-06 18:58:39 -05:00
|
|
|
{ on = "<Tab>"; run = "spot"; desc = "Spot hovered file"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-06 18:58:39 -05:00
|
|
|
{ on = "M"; run = "plugin mount"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-06 18:58:39 -05:00
|
|
|
{ on = "p"; run = "plugin smart-paste"; desc = "Paste into the hovered directory or CWD"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-17 12:12:38 -05:00
|
|
|
{ on = "C"; run = "plugin ouch zip"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-17 12:12:38 -05:00
|
|
|
{ on = "T"; run = "plugin smart-tab"; desc = "Create a tab and enter the hovered directory"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
|
2025-02-21 11:05:09 -05:00
|
|
|
{ on = "<Backspace>"; run = "remove"; }
|
2025-04-04 15:38:54 -04:00
|
|
|
{ on = ["d" "d"]; run = "remove"; desc = "Delete files/folders"; }
|
|
|
|
{ on = ["d" "u"]; run = "plugin restore"; desc = "Restore last deleted files/folders"; }
|
2025-02-26 22:18:59 -05:00
|
|
|
|
2025-04-04 15:38:54 -04:00
|
|
|
{ on = "f"; run = "plugin smart-filter"; desc = "Find file"; }
|
|
|
|
{ on = "F"; run = "find --smart"; desc = "Find file"; }
|
2025-02-26 22:18:59 -05:00
|
|
|
|
|
|
|
|
2025-02-05 00:50:55 -05:00
|
|
|
];
|
|
|
|
};
|
2025-02-06 18:58:39 -05:00
|
|
|
settings = {
|
|
|
|
manager = {
|
|
|
|
sort_dir_first = false;
|
2025-02-12 16:15:41 -05:00
|
|
|
linemode = "mtime";
|
|
|
|
show_symlink = true;
|
2025-02-06 18:58:39 -05:00
|
|
|
};
|
|
|
|
opener = {
|
2025-03-05 12:45:09 -05:00
|
|
|
# open = [
|
|
|
|
# { run = "plugin open-with-cmd block"; desc = "Open with command in the terminal"; }
|
|
|
|
# { run = "plugin open-with-cmd"; desc = "Open with command"; }
|
|
|
|
# ];
|
2025-02-06 18:58:39 -05:00
|
|
|
edit = [
|
2025-02-09 12:37:06 -05:00
|
|
|
{ run = "emacsclient -r -n \"$@\""; desc = "open in current emacsclient"; orphan = true; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
extract = [
|
2025-02-17 11:45:20 -05:00
|
|
|
{ run = "ouch d -y \"$@\""; desc = "Extract here with ouch"; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
plugin = {
|
2025-02-12 16:15:41 -05:00
|
|
|
prepend_preloaders = [
|
|
|
|
{ name = "/mnt/**"; run = "noop"; }
|
2025-02-17 11:45:20 -05:00
|
|
|
{ name = "/home/emenel/Mounts/**"; run = "noop"; }
|
2025-02-12 16:15:41 -05:00
|
|
|
];
|
2025-03-05 12:45:09 -05:00
|
|
|
prepend_previewers = [
|
|
|
|
{ name = "*.csv"; run = "rich-preview"; }
|
|
|
|
{ name = "*.md"; run = "rich-preview" ; }
|
|
|
|
{ name = "*.rst"; run = "rich-preview"; }
|
|
|
|
{ name = "*.ipynb"; run = "rich-preview"; }
|
|
|
|
{ name = "*.json"; run = "rich-preview"; }
|
|
|
|
{ name = "*.lisp"; run = "rich-preview"; }
|
|
|
|
{ name = "*.el"; run = "rich-preview"; }
|
|
|
|
{ name = "*.org"; run = "rich-preview"; }
|
|
|
|
];
|
2025-02-06 18:58:39 -05:00
|
|
|
append_previewers = [
|
2025-03-05 12:45:09 -05:00
|
|
|
{ mime = "{image,audio,video}/*"; run = "mediainfo";}
|
|
|
|
{ mime = "application/x-subrip"; run = "mediainfo";}
|
2025-02-06 18:58:39 -05:00
|
|
|
# Archive previewer
|
|
|
|
{ mime = "application/*zip"; run = "ouch"; }
|
|
|
|
{ mime = "application/x-tar"; run = "ouch"; }
|
|
|
|
{ mime = "application/x-bzip2"; run = "ouch"; }
|
|
|
|
{ mime = "application/x-7z-compressed"; run = "ouch"; }
|
|
|
|
{ mime = "application/x-rar"; run = "ouch"; }
|
|
|
|
{ mime = "application/x-xz"; run = "ouch"; }
|
2025-02-23 12:42:17 -05:00
|
|
|
{ mime = "application/octet-stream"; run = "ouch"; }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
2025-03-05 12:45:09 -05:00
|
|
|
_spotters = [
|
2025-02-06 18:58:39 -05:00
|
|
|
{ name = "*"; run = "file-extra-metadata"; }
|
|
|
|
];
|
|
|
|
prepend_fetchers = [
|
2025-04-04 15:38:54 -04:00
|
|
|
# {
|
|
|
|
# id = "mime";
|
|
|
|
# name = "*";
|
|
|
|
# run = "mime-ext";
|
|
|
|
# prio = "high";
|
|
|
|
# }
|
2025-03-05 12:45:09 -05:00
|
|
|
# {
|
|
|
|
# id = "git";
|
|
|
|
# name = "*";
|
|
|
|
# run = "git";
|
|
|
|
# }
|
|
|
|
# {
|
|
|
|
# id = "git";
|
|
|
|
# name = "*/";
|
|
|
|
# run = "git";
|
|
|
|
# }
|
2025-02-06 18:58:39 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2025-02-05 00:50:55 -05:00
|
|
|
};
|
|
|
|
|
2025-03-21 16:50:54 -04:00
|
|
|
xdg.configFile."yazi/theme.toml".source = ./yazi/theme.toml;
|
|
|
|
xdg.configFile."yazi/flavors".source = ./yazi/flavors;
|
2025-04-04 15:38:54 -04:00
|
|
|
# xdg.configFile."yazi/plugins".source = ./yazi/plugins;
|
2025-02-05 00:50:55 -05:00
|
|
|
}
|