nixvim
                                
                                 nixvim copied to clipboard
                                
                                    nixvim copied to clipboard
                            
                            
                            
                        [BUG] Neorg does not work due to missing dependency
| Field | Description | 
|---|---|
| Plugin | neorg | 
| Nixpkgs | unstable | 
| Home Manager | unstable | 
- [x] I have read the FAQ and my bug is not listed there.
Description
It seems the version of the neorg plugin got bumpped and now no longer works due to a missing dependency. on lua-utils. It seems this dependency was added in v8.0.0 but the change must have only recently hit nixpkgs unstable.
Minimal, Reproducible Example (MRE)
programs.nixvim = {
    plugins.neorg.enable = true;
}
I think this is the related discussion: https://github.com/nvim-neorg/neorg/issues/1342 I just use the neorg from nixos-23.11 branch For standalone configuration: https://github.com/nix-community/nixvim/discussions/1397#discussioncomment-9054044
In the mean time yes I know I can use the Neorg package from stable, but at the same time it would be nice for the latest version be fixed as well.
I think a fix for that needs to be landed in nixpkgs for a proper fix, not in nixvim. I'd love for a simple way to fix it without resorting to the stable fix, cause it kinda doesn't work on my end.
Thank you for reporting. I am aware about this. However, we cannot do much on the nixvim side.
The solution has to be implemented on the nixpkgs side: we should package neorg as a lua package (luaPackages.neorg) there and build vimPlugins.neorg on top of it.
This is worked on here.
Another solution is found is to declare their official overlay to override the bugged package https://github.com/nvim-neorg/nixpkgs-neorg-overlay
they updated there pkg
now it should work ha ?
they updated there pkg, now it should work ha ?
I'll close this then. We can re-open if the issue is still present.
I'll close this then. We can re-open if the issue is still present.
The update has nothing to do with the general issue which is not neorg-specific.
Indeed, the core problem here is that the lua dependencies of "neovim plugins" in nixpkgs (i.e. built from a luaPackage.*) are not propagated.
This is the same reason why luasnip complains with missing the jsregexp library.
Is there something still needed for this to work?
Is there something still needed for this to work?
This PR is where it's being worked on: https://github.com/NixOS/nixpkgs/pull/302442
As mentioned above, you can use the overlay as a temporary workaround.
sorry, came out rude, thank you for the response
For a temporary solution on 24.05 you can just add the dependencies as extraPlugins to nixvim.
programs.nixvim.extraPlugins = [
    (pkgs.vimUtils.buildVimPlugin {
      inherit (pkgs.luaPackages.lua-utils-nvim) pname version src;
    })
    (pkgs.vimUtils.buildVimPlugin {
      inherit (pkgs.luaPackages.pathlib-nvim) pname version src;
    })
    (pkgs.vimUtils.buildVimPlugin {
      inherit (pkgs.luaPackages.nvim-nio) pname version src;
    })
];
This alone will get it to work on nixos-24.05 (as of writing rev cf05eeada35e122770c5c14add958790fcfcbef5 ).
And if you want to bring in the more recent neorg from the current unstable(rev c3392ad349a5227f4a3464dce87bcc5046692fce), you can just swap out the neovim package of nixvim to meet the 0.10 minimum requirement like so:
programs.nixvim.package = nixpkgs-unstable.legacyPackages.${pkgs.system}.neovim-unwrapped;
programs.nixvim.plugins.neorg.package = nixpkgs-unstable.legacyPackages.${pkgs.system}.vimPlugins.neorg;
https://github.com/NixOS/nixpkgs/pull/302442 has been merged so we should have a neorg plugin working out of the box very soon !
Sorry for the massive delay...
The patch has landed in nixos-unstable and this issue is now solved.
You don't need to use the overlay anymore.
Warning
If you have performance.combinePlugins enabled, make sure to add "neorg" to performance.combinePlugins.standalonePlugins.
Otherwise, it will keep complaining about missing dependencies.