Still struggling with yazi plugins

I’m still trying to get any plugins to work in yazi. I’m using home manager for this.

Background: I managed, with help here, to get bookmarks to work (building it myself), only for it fail to build after a recent nixpkgs update (I use unstable). In the course of fixing it, I realized that I had be searching for packages on 26.05, not unstable, and that there are a slew of plugins now already packaged, including bookmarks. I also decided to move the module to home manager to take advantage of it’s expanded options.

Here is my module. yazi itself works fine, but none of the plugins work.

❯ \cat biscotty/yazi.nix
{ pkgs, ... }:
{
  programs.yazi = {
    enable = true;
    enableZshIntegration = true;
    shellWrapperName = "y";
    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";
          }
          {
            on = [ "F" ];
            run = "plugin jump-to-char";
            desc = "Jump to char";
          }
        ];
      };
    };
    plugins = with pkgs.yaziPlugins; {
      inherit nord;
      inherit starship;
      inherit jump-to-char;
      bookmarks = {
        package = bookmarks;
        setup = true;
        settings = {
          last_directory = {
            enable = false;
            persist = false;
            mode = "dir";
          };
          persist = "none";
          desc_format = "full";
          file_pick_mode = "hover";
          custom_desc_input = false;
          show_keys = false;
          notify = {
            enable = false;
            timeout = 1;
            message = {
              new = "New bookmark '<key>' -> '<folder>'";
              delete = "Deleted bookmark in '<key>'";
              delete_all = "Deleted all bookmarks";
            };
          };
        };
      };
    };
  };
}

Thanks in advance.

That’s because my change switched to using a patch instead of switching to the fork, then it landed in nixpkgs :wink:.

What timing, lol. I still don’t understand why none of the plugins are “active”. I see them being added when I rebuild, but I have no functionality.

Two things to note from the upstream plugin repository for pkgs.yaziPlugins.starship.

  1. Add this to ~/.config/yazi/init.lua:

    require("starship"):setup()
    
  2. Make sure you have starship installed and in your PATH.

To achieve number 1 with home-manager, you need to set programs.yazi.plugins.<name>.setup to true, replace <name> as required for your setup. To achieve number 2, you need to install pkgs.starship, the plugin does not do this.

I have tested this on my machine.

I recommend perusing the upstream plugin repositories as they will likely have configuration that is required to make them work.

I had tried both with and without this, to no avail.

pkgs.starship was already installed, I use it for other things as well.

I have, and that’s where I got the config info for bookmarks which you can see. I don’t think my problem is any specific plugin, but the fact that none of them are working.

  • Do you have anything present under $XDG_CONFIG_HOME/yazi, linked to the Nix store with home-manager in their path? For example a plugins directory?

  • Could you try replacing your replacing your module with the one given at the homepage for pkgs.yaziPlugins.nord? Just to test a known good configuration and see if it still fails.

  • Do you use Home Manager for other things, or is this your first time using it?

  • Which commit are you using for NixOS and for Home Manager?

  • Can you share the rest of your configuration?

I don’t appear to have anything assigned to this variable.

It works, although it gives a deprecation warning. Interestingly, this uses initLua. My reading of the docs was that yazi.plugins.<name>.setup took care of writing the lua file. Maybe this is my problem?

I do use it, but for very few things. I used to use it extensively, but most everything now is managed at the system level.

    "home-manager": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1792703141,
        "narHash": "sha256-3X34FaSeMJXMx8CK/BN6sZ9knwNauuiJXQhLM+bQQuI=",
        "owner": "nix-community",
        "repo": "home-manager",
        "rev": "6750249c69969d09d952efaf3fab88a2bdac7ec6",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "ref": "master",
        "repo": "home-manager",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1792502884,
        "narHash": "sha256-ij8QUxzTOHovLrNOxVRx+RAhGQFOMsJbji0veiatH5k=",
        "rev": "02c087f3fe673c9e317f206a627cb6b910336dbe",
        "type": "tarball",
        "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1097682.02c087f3fe67/nixexprs.tar.xz"
      },
      "original": {
        "type": "tarball",
        "url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1790769526,
        "narHash": "sha256-5AIVFLRcx8YAwbFTVPTs7YhwJH7JyHfAQsvXmpovcXI=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "c9fe7d12cd78d1adcd12dd15e24432dde5b155a0",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixpkgs-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    }

My configuration.

I sure appreciate your time with this.

I realized that my keymap was nested under settings. Moved it to its proper place, and bookmarks and jump-to-char is working. Thanks for the other snippets which enabled the nord theme. Yay!

Thank you