Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use "lua" (and other) plugin config types #329

Closed
ForsakenHarmony opened this issue Apr 12, 2023 · 3 comments
Closed

Can't use "lua" (and other) plugin config types #329

ForsakenHarmony opened this issue Apr 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ForsakenHarmony
Copy link
Contributor

Plugin affected: third party
Nixpkgs channel: 22.11
Home-manager version:

Description

home-manager allows you to choose which type of config you want to add
https://github.com/nix-community/home-manager/blob/master/modules/programs/neovim.nix#L16

Config

{
  plugin = which-key-nvim;
  type = "lua";
  config = ''
    require("which-key").setup({})
  '';
}

throws

error: The option `home-manager.users.hrmny.programs.nixvim.extraPlugins."[definition 13-entry 17]".type' does not exist. Definition values:
       - In `/nix/store/8w1df8s8vxipfz20fxr6w3dzgk3y4d7q-source/flake.nix': "lua"
@ForsakenHarmony ForsakenHarmony added the bug Something isn't working label Apr 12, 2023
@traxys
Copy link
Member

traxys commented Apr 12, 2023

Nixvim does not work like home-manager, the extraPlugins are a list of derivations that are directly passed to neovim. You should not really need to use it directly, instead enabling plugins through 'plugins..enable'.

If your plugin is not packaged you will need to either open an issue to request for it, or add the plugin derivation to extraPlugins and the plugin configuration to extraConfigLua.

I think which-key-nvim is not packaged for nixvim so you would need the second approach

@traxys traxys closed this as completed Apr 12, 2023
@ForsakenHarmony
Copy link
Contributor Author

ForsakenHarmony commented Apr 18, 2023

@traxys this is an example entry in extraPlugins, so it's already using the second approach

the second approach could just be improved

@traxys
Copy link
Member

traxys commented Apr 18, 2023

This is not really the goal of nixvim, the goal is mostly to have a convenient way to map the lua configuration as Nix expressions, and right now the only path we support is through global options in the nixvim module. We may want to explore other ways to package plugins in the future in order to support things like lazy loading, but nobody has looked into that yet.

In the meantime if you want I packaged which-key-nvim as a nixvim module, you can check the options here (The documentation is not the best in the world, we need to improve it too)

Don't hesitate to give suggestions to improve nixvim!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants