Nixvim avante plugin setup help

Hi all,

I’m trying to get the avante plugin working with nixvim but keep getting an error.

Error executing lua callback: ...mPackages/start/vimplugin-plugin-pack/lua/avante/llm.lua:280: Make sure to build avante (missing avante_templates)

I opened an issue on the nixvim GitHub, but not sure there will be any movement there.

This is a minimum reproducible example from the issue:

{
  programs.nixvim.plugins.avante = {
    enable = true;
    settings = {
      debug = true;
      auto_suggestions_provider = "ollama";
      provider = "ollama";
      providers = {
        ollama = {
          # endpoint = "http://localhost:11434";
          is_env_set = ''
            require ("avante.providers.ollama").check_endpoint_alive
          '';
          model = "qwen3:4b";
        };
      };
    };
  };
}

Ollama does work on the command line and also with openweb-ui. Any guidance would be appreciated, since I’ve spent copious amount of time on this with no success. I’m running a Dell XPS 15 9560 with an NVIDIA GeForce GTX 1050.

Here is the full error I’m seeing:

I can press enter to clear it, but any key I press brings the error back up.

seems like avante can’t find the rust library it works with. Nixpkgs builds it correctly as far as I know. You might be missing one load_lib call. Which should be totally unnecessary but when I tried to fix it, the PR got reverted feat: obsoletes "require("avante_lib").load()" by teto · Pull Request #2324 · yetone/avante.nvim · GitHub

You mean this?

      extraConfig = {
        plugins.avante.luaConfig.pre = ''
          require("avante_lib").load()
          require("avante").setup()
        '';
      };

I tried that and nothing seemed to change. I’m currently on the road, but will dig into this in a couple of hours.

This is my current avante.nix file, which is loaded by Home Manager:

{
  programs.nixvim.plugins.avante = {
    enable = true;
    settings = {
      debug = true;
      behaviour = {
        use_absolute_path = true;
      };
      diff = {
        autojump = true;
        debug = false;
        list_opener = "copen";
      };
      extraConfig = {
        plugins.avante.luaConfig.pre = ''
          require("avante_lib").load()
          require("avante").setup()
        '';
      };
      highlights = {
        diff = {
          current = "DiffText";
          incoming = "DiffAdd";
        };
      };
      hints = {
        enabled = true;
      };
      mappings = {
        diff = {
          both = "cb";
          next = "]x";
          none = "c0";
          ours = "co";
          prev = "[x";
          theirs = "ct";
        };
      };
      auto_suggestions_provider = "ollama";
      provider = "ollama";
      providers = {
        ollama = {
          # endpoint = "http://localhost:11434";
          is_env_set = ''
            require ("avante.providers.ollama").check_endpoint_alive
          '';
          model = "qwen3:4b";
          # disable_tools = true;
          # extra_request_body = {
          #   num_ctx = 32768;
          #   temperature = 0;
          # };
          # stream = true;
        };
      };
      windows = {
        sidebar_header = {
          align = "center";
          rounded = true;
        };
        width = 30;
        wrap = true;
      };
    };
  };
}

The avante_templates file seems to be there, so it is just not loading?
./store/niap82jnrk4p1lh11gy33y5jkgqy83pp-avante-nvim-lib-0.0.27-unstable-2025-12-09/lib/libavante_templates.so

Looking into how to troubleshoot this. Strange that I can’t seem to find anybody else with this issue. Likely a “me problem”.

that’s odd, the libraries live in build/ on nixpkgs’s master. Do you have any override ?

NVF - Options …. nvf …

I don’t think I have any overrides set. I wonder if it’s got something to do with me setting up ollama and openweb-ui through configuration.nix and nixvim + plugins through home manager. Digging more as I can…

Any thoughts on how to troubleshoot would be great (learning opportunity :sweat_smile: ).

Thanks for the option. I’ll explore that if I can’t get this current path to work. Not sure I want to open another can of worms just yet.

you can compare your avante.nvim derivation with the nixpkgs’one with nix-diff to check if they have any difference.