Skip to content

neovim: load the wrapper generated lua#8734

Draft
teto wants to merge 4 commits intonix-community:masterfrom
teto:teto/neovim-provider-in-initLua
Draft

neovim: load the wrapper generated lua#8734
teto wants to merge 4 commits intonix-community:masterfrom
teto:teto/neovim-provider-in-initLua

Conversation

@teto
Copy link
Collaborator

@teto teto commented Feb 13, 2026

Description

Logical follow up once NixOS/nixpkgs#487390 is merged.

This means an init.lua is now always generated which will probably break a lot more configs than the recent neovim-related changes. I would like to avoid adding yet a new option just to keep the old behavior as we would get 2 different ways to launch neovim, making the behavior and testing different in an obscure way for the user.

The manual user solution to update their config would be the same as for previous PR:
5786e42

At the same time, I fear it breaks too many configs for us to ignore to here is what I came up with:

To avoid creating a new option while keeping current behavior:

  1. check if the HM generated init lua is empty and if yes load the provider config via the wrapper, thus keeping current behavior.
  2. If the user has already configured some lua, then we just add some more to an already existing initLua. This makes config simpler and if the user doesn't set any extraPackages, we could actually get rid of the wrapped nvim executable and just use neovim-unwrapped (hourra \o/)

Ideally I would like to get rid of 1 (to avoid special casing HM, compared to nixpkgs neovim wrapper), maybe by displaying some warning to user on how to update their config.
In the short term, if I could get 2 running on my machine, it would be great. Would make neovim work as on other distrib, and let me hack on neovim C code without further nix hacks.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

teto added 3 commits February 12, 2026 15:16
now that home-manager always generates an init.lua we can take the
wrapper output instead of reimplemnting stuff in HM (notwithstanding rtp
changes that are not needed in HM).
This is necessary to keep the provider configuration available after
this change NixOS/nixpkgs#487390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant