The module wraps yazi with your config and adds the wrapped yazi to environment.systemPackages, so remove the unconfigured version from your environment.systemPackages.
I didn’t originally have it in environment.systemPackages, but without it I get
Failed to parse config "/nix/store/ma18cxp5y93xh33dqyf9lspn2d3xjg6h-YAZI_CONFIG_HOME/yazi.toml"
Caused by:
TOML parse error at line 3, column 1
|
3 | show_hidden = true
| ^^^^^^^^^^^
must be 1-20 characters in kebab-case
Press any key to continue with preset settings...
Ah, so you shadowed it with an unconfigured yazi due to the configuration error.
It looks like you’re missing the mgr key. Since it looks like all your settings are for mgr, you can probably just use yazi.mgr instead of yazi under settings.
No worries, just recategorized it myself with my TL3 pemissions.
So the plugin is loaded, and I have added the keymaps to access the functionality. I can add and delete bookmarks, and ' brings up the list of saved bookmarks. However, when I choose one from the list, nothing happens, and there is a background error
runtime error: ?:?: attempt to call a nil value (field 'mgr_emit')
stack traceback:
?: in function 'bookmarks.entry'
This is my current yaxi.nix
❯ \cat nixos/yazi.nix
{ pkgs, ... }:
{
# environment.systemPackages = with pkgs; [
# yazi
# ];
programs.yazi = {
enable = true;
settings = {
yazi.mgr = {
ratio = [
1
3
3
];
sort_by = "natural";
sort_sensitive = true;
sort_reverse = false;
sort_dir_first = true;
linemode = "none";
show_hidden = true;
show_symlink = true;
};
keymap = {
mgr.prepend_keymap = [
{
on = [ "n" ];
run = "plugin bookmarks save";
desc = "Save current position as a bookmark";
}
{
on = [ "'" ];
run = "plugin bookmarks jump";
desc = "Jump to a bookmark";
}
{
on = [
"b"
"d"
];
run = "plugin bookmarks delete";
desc = "Delete a bookmark";
}
{
on = [
"b"
"D"
];
run = "plugin bookmarks delete_all";
desc = "Delete all bookmarks";
}
];
};
};
plugins = {
bookmarks = pkgs.yaziPlugins.bookmarks;
};
};
}
That looks like you’re overriding the yazi package src itself (which works because pkgs.yazi is a runCommand-based wrapper, and not the actual yazi rust crate). You should be overridingpkgs.yaziPlugins.bookmarks.
I also just made a nixpkgs PR here, so you won’t need to override once a committer merges it and makes its way into channels: