Does anyone know how to use these new yaziPlugins
such as yaziPlugins.mediainfo
?
I am currently using ya pack -a
to add yazi plugins, but would be interested in a more NixOS way of doing this in home-manager or configuration.nix.
Does anyone know how to use these new yaziPlugins
such as yaziPlugins.mediainfo
?
I am currently using ya pack -a
to add yazi plugins, but would be interested in a more NixOS way of doing this in home-manager or configuration.nix.
I haven’t tried but I imagine you could use the plugins option. Probably just set it like
programs.yazi.plugins = {
foo = pkgs.yaziPlugins.foo
}
hey! this is a snippet of what i have:
programs.yazi = {
enable = true;
package = pkgs.yazi;
plugins = {
"bypass.yazi" = pkgs.yaziPlugins.bypass;
"chmod.yazi" = pkgs.yaziPlugins.chmod;
"full-border.yazi" = pkgs.yaziPlugins.full-border;
"lazygit.yazi" = pkgs.yaziPlugins.lazygit;
"mediainfo.yazi" = pkgs.yaziPlugins.mediainfo;
"no-status.yazi" = pkgs.yaziPlugins.no-status;
"ouch.yazi" = pkgs.yaziPlugins.ouch;
"restore.yazi" = pkgs.yaziPlugins.restore;
"smart-enter.yazi" = pkgs.yaziPlugins.smart-enter;
"toggle-pane.yazi" = pkgs.yaziPlugins.toggle-pane;
};
# ...
};
e.g. “ouch.yazi” is the folder name, apparently yazi only understands plugins with the “*.yazi” postfix in the plugin’s directory (EDIT: no longer?), and the rest is the package name after the equals mark. but if there is something that isnt in the repo you can just use:
ya pack -a owner/plugin
e.g.
ya pack -a hankertrix/augment-command
WHICH ISNT DECLARATIVE, if you prefer to keep things permanently! this will add plugins to ~/.config/yazi/plugins/
folder, which is a headache when you already have some declared system-wide… i mean, perhaps you can use flakes (such as this one) or fetchgit
, or suggest/contribute whatever plugin you want to the nix repo yourself! ive heard its simple as a shrimple - just ask around!
anyway, then, add the absolute path to the same list above, e.g.:
"augment-command.yazi" = "/home/user/.config/yazi/plugins/augment-command.yazi";
this unfortunately works the same for init.lua
, which i have discovered just recently (you cant just ‘‘text’’; a lua file, i suppose, so instead it is just an absolute path to one – EDIT: ooh the HM option has programs.yazi.initLua
that IS of type of “strings”, so definitely have a look at that!)… so, if you want to configure those plugins even more - it’s gonna take some time, of course, that is if it isnt just a keybinding or a previewer, which is… simpler, yep, but very tedious. i have like about 2000 lines of just yazi in my configuration.nix
… but that is as far as i know. havent tried to do that with home-manager
yet! anyway… there arent as much yaziPlugins
as there are in awesome-yazi or something, but yeah… oh, by the way, some might not even fetch with ya pack
(os error 2), so keep that in mind, maybe git clone
would work! sod it, im also gonna try this in a minute…
P.S. just a random tip: do not use *-unwrapped
for any package, unless you want stuff to… not work. for example, with yazi, were you to try pkgs.yazi-unwrapped
, you would get either a “anonymous lambda” or plugins and settings to not work at all. that is because *-unwrapped
are unmodifiable binaries (they also have no icon shortcuts)! learned that the hard way! correct me if im wrong though…
Awesome. Thanks for this.
I got it working, although I got this error:
warning: Plugins like `programs.yazi.plugins."chmod.yazi"` should no longer have the suffix ".yazi" in their attribute name.
The plugin will be linked to `$XDG_CONFIG_HOME/yazi/plugins/chmod.yazi.yazi`.
You probably want to rename it to `programs.yazi.plugins."chmod"`.
Removing the suffix .yazi
did the trick.
For now, plugins that don’t yet exist as yaziPlugins
I am continuing to install with ya pack -a
. Hopefully they will eventually be included.
And yes, the HM option programs.yazi.initLua
works great. I have set a couple of items in it that way.
oh wow that… that must’ve been changed literally yesterday LOL. it doesnt say anything like that for me though… well, okay, no problem!