nixvim icon indicating copy to clipboard operation
nixvim copied to clipboard

[BUG] Neorg does not work due to missing dependency

Open vendion opened this issue 1 year ago • 11 comments

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;
}

vendion avatar Apr 08 '24 03:04 vendion

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

amalgame21 avatar Apr 09 '24 05:04 amalgame21

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.

vendion avatar Apr 09 '24 10:04 vendion

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.

Kintaro avatar Apr 09 '24 17:04 Kintaro

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.

GaetanLepage avatar Apr 10 '24 08:04 GaetanLepage

Another solution is found is to declare their official overlay to override the bugged package https://github.com/nvim-neorg/nixpkgs-neorg-overlay

71zenith avatar May 13 '24 08:05 71zenith

they updated there pkg image now it should work ha ?

sachinchaudhary1808 avatar May 30 '24 06:05 sachinchaudhary1808

they updated there pkg, now it should work ha ?

I'll close this then. We can re-open if the issue is still present.

MattSturgeon avatar May 30 '24 13:05 MattSturgeon

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.

GaetanLepage avatar May 30 '24 13:05 GaetanLepage

Is there something still needed for this to work?

Thiago-Assis-T avatar Jul 06 '24 16:07 Thiago-Assis-T

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.

MattSturgeon avatar Jul 06 '24 16:07 MattSturgeon

sorry, came out rude, thank you for the response

Thiago-Assis-T avatar Jul 06 '24 16:07 Thiago-Assis-T

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;

menixator avatar Aug 04 '24 02:08 menixator

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...

GaetanLepage avatar Sep 24 '24 08:09 GaetanLepage

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.

GaetanLepage avatar Sep 29 '24 14:09 GaetanLepage