nvim-neorg / neorg

Modernity meets insane extensibility. The future of organizing your life in Neovim.
GNU General Public License v3.0
6.31k stars 209 forks source link

Luarocks Issues Thread #1342

Open vhyrro opened 5 months ago

vhyrro commented 5 months ago

If you're probably here you're either angry or you're sad :|

The latest update, 8.0.0, has been a breaking change for users. This isn't a breaking change just because I felt like it, rather it paves the way forward for making Neorg expansive and more stable than it was before. We just need to jump through the initial hurdles.

If you have issues, please read the blog post I made. It will have you covered on how to fix things.

If you don't want to deal with the breakages, feel free to roll back to version v7.0.0 - everything will continue to run there.

If you're having errors in lazy, I highly encourage you to restart Neovim and try manually rerunning :Lazy build luarocks.nvim and, if that succeeds, running :Lazy build neorg afterwards. If you get any errors which you do not understand, please post them here!

Thank you lot for the patience! Happy note taking.

EDIT:

If you have a build = ":Neorg sync-parsers" step in your Neorg configuration be sure to remove it. That'll overwrite the build.lua build step and make the build process fail.

benlubas commented 5 months ago

@morrismuehl I have both of them working, I'm also compiling nightly with the magick rock installed via nix. I don't think they conflict. But I'm not using HM.

Alternatively, you could install all of neorg's luarock deps the same way you're installing the magick rock and then disable the neorg's build script, though you'll have to manually update the deps when neorg updates.

pysan3 commented 5 months ago

@morrismuehl unfortunately I have no plans to support Nix users in my tutorial (unless someone makes a PR; I will blindly accept it without testing).

There are many awesome nix users on Discord so you might want to ask them.

BoltsJ commented 5 months ago

I can't get this to work. I'll miss this plugin, but luarocks is proving to be too much of a headache. I'm not not "all in" on lua and am not going to layer packages into my ostree system just for a notes plugin.

flexagoon commented 5 months ago

@BoltsJ the only package this requires is luajit. You can layer it, or install it in a Toolbox, or from Homebrew, or whatever package installation method you prefer.

This isn't the only nvim plugin with external dependencies - there are, for example, many LSP servers that require node.js to be installed, and TreeSitter parsers require gcc, which is also not pre-installed on Silverblue. Not sure why you're so opposed to luajit specifically.

BoltsJ commented 5 months ago

I don't edit my notes from toolbox. I don't want to set up a toolbox just for note-taking.

faldor20 commented 5 months ago

I had the same issue as @CRAG666 where i got a bunch of weird manifest errors and this: Error: Could not satisfy dependency nvim-nio ~> 1.7: No results matching query were found for Lua 5.1. Turns out i had the busybox version of wget installed I tested this by running wget --version which said "busybox" @pysan3 Maybe you could specify that as a debug step in your migration guide :)

pysan3 commented 5 months ago

@faldor20 PR welcome ;)

austinbutler commented 5 months ago

For Nix could this not be included in https://github.com/nvim-neorg/nixpkgs-neorg-overlay?

moebiusband73 commented 5 months ago

Can you elaborate why you are doing this? Also why you need to build luarocks and not use the one that is provided on the system already. The dependency on lua 5.1 (a release that is more than 13 years old) and which I cannot install with homebrew anymore is a deal breaker for me. I am not into lua, but I hope they do not do the same mistake Python did with this Python 2 vs 3 mess.

Bottomline: I don't care. Neorg should be a tool I use and not something I waste my time with. I cannot believe that installing a custom package manager with a very new and obviously immature neovim plugin is really required to push forward this project. At the moment you make it hard to impossible for others to use this plugin. This looked promising, but I cannot rely on something for daily work that breaks all the time.

benlubas commented 5 months ago

@moebiusband73 pin to v7.* then. Your plugin will not break, and you can update whenever you have the time. Also, as far as I know, there is no issue installing on macos via brew. In fact, it's the recommended way to install in the tutorial's migration guide).

As far as why the project is moving in this direction, the reasoning is pretty clear in the blog post linked at the top of the thread.

flexagoon commented 5 months ago

The dependency on lua 5.1 (a release that is more than 13 years old) and which I cannot install with homebrew anymore is a deal breaker for me

@moebiusband73 you can install luajit with Homebrew, it works as well.

Neovim itself, as well as all Neovim plugins, are written for Lua 5.1 or Luajit (which also implements the Lua 5.1 spec).

Explanation can be found here:

https://neovim.io/doc/user/lua

moebiusband73 commented 5 months ago

Well luajiit got me a few steps further, Neorg is still missing plugins. The thing is that developers accept to provide a fragile product. And yes I am aware this is OpenSource and I do not pay for it. I also develop Open Source tools, but I still feel a responsibility to not make things for my users more difficult. I switched from vim to nvim 2 years ago and while I like the features of nvim, the overall experience is a lot more fragile. All the time stuff breaks, plugins fail to install or build (I also happen to have an OpenBSD Laptop) and certain functionality is not available anymore. The text editor is my most important tool and I just cannot afford to fix things before being able to work.

Now back to this issue, setting up a complete duplicate package manager within nvim sounds like a really terrible idea to me. Especially because it does not seem to integrate well with Lazy, which is one of the more popular package manager out there. You argue this makes things easier, but at the moment this is a one man show and the believe that all the different setups, OS and environments just work like that are overoptimistic to say the least. Good luck, you seem to have very good nerves and hopefully a lot of time!

And yes everything can be fixed, but I just don't have the time to debug and fix a tool that I urgently need and that should be the most reliable thing on my computer.

morrismuehl commented 5 months ago

@benlubas

I changed my nix config to not use hm, essentially to the snippet that you provided in the manual. Neorg works now (albeit somewhat unreliably), but I am no longer running the nightly version of neovim. If I understood correctly you are running nightly so I don't really understand why. Any idea what the problem is, or where I could look for help?

vhyrro commented 5 months ago

@moebiusband73 everything continues to just work if you pin to version 7 and wait for us to resolve the issues :)

The thing is that developers accept to provide a fragile product

This is untrue for many reasons. The most obvious being that we version everything. If the setup is not running on your end, that's lazy deciding not to run the build script, not us. Hence it's not Neorg being fragile. Luarocks isn't something new at all, it has been around for a long while (even during the packer days).

Furthermore, it's far from a one-man show. There are now several dozens of plugins (including basically all of the most popular ones) on luarocks. If my memory serves me right four new ones landed in the mainline repository just yesterday. Those plugins can afford to keep backwards-compatibility, and that's awesome. If Neorg could provide perfect compatibility, it would, but as you can see from the blog posts, it simply can't :p

I understand that things "just working" and ease of use/debugging is of high priority, and that's exactly what I'm working towards with all of this. I'll also be looking at lazy to see if I can make the build logic more consistent (perhaps folke will be kind enough to look into himself, he's the wizard after all). I'm exclusively dedicating developer time to make the whole experience not just on par with what we had before, but better than what we had before. I'll be conjuring up kickstart configurations which get you started with an immediate working version of Neorg as well as guides.

Neorg is not your average "minimal, markdown based note taking tool" Neovim plugin. Testing the limits of what's possible is a part of what we do. Hope that clears things up, feel free to ask about anything if you need further answers :)

vhyrro commented 5 months ago

As for everyone else who might be having Neorg problems, sorry, I've been away for the past four days. I'll be looking into all of your issues and making some parts easier to debug. I just made the checkhealth more advanced which is a good start :)

benlubas commented 5 months ago

@benlubas

I changed my nix config to not use hm, essentially to the snippet that you provided in the manual. Neorg works now (albeit somewhat unreliably), but I am no longer running the nightly version of neovim. If I understood correctly you are running nightly so I don't really understand why. Any idea what the problem is, or where I could look for help?

Yup I'm running nightly, the snippet in the tutorial is slightly simplified from my actual setup. I build nightly from source, I specify the source as an input to my system flake and then pass it as the source to wrapNeovimUnstable. I pin the version of nightly that I'm using b/c the latest version at the time I switched to nightly was crashing so I had to pin. That crash might be resolved if you want to try to build the latest nightly, but I'm not sure.

defining the input using that input


What do you mean by "somewhat unreliably"?

cc @morrismuehl

moebiusband73 commented 5 months ago

@moebiusband73 everything continues to just work if you pin to version 7 and wait for us to resolve the issues :)

The thing is that developers accept to provide a fragile product

This is untrue for many reasons. The most obvious being that we version everything. If the setup is not running on your end, that's lazy deciding not to run the build script, not us. Hence it's not Neorg being fragile. Luarocks isn't something new at all, it has been around for a long while (even during the packer days).

Furthermore, it's far from a one-man show. There are now several dozens of plugins (including basically all of the most popular ones) on luarocks. If my memory serves me right four new ones landed in the mainline repository just yesterday. Those plugins can afford to keep backwards-compatibility, and that's awesome. If Neorg could provide perfect compatibility, it would, but as you can see from the blog posts, it simply can't :p

I understand that things "just working" and ease of use/debugging is of high priority, and that's exactly what I'm working towards with all of this. I'll also be looking at lazy to see if I can make the build logic more consistent (perhaps folke will be kind enough to look into himself, he's the wizard after all). I'm exclusively dedicating developer time to make the whole experience not just on par with what we had before, but better than what we had before. I'll be conjuring up kickstart configurations which get you started with an immediate working version of Neorg as well as guides.

Neorg is not your average "minimal, markdown based note taking tool" Neovim plugin. Testing the limits of what's possible is a part of what we do. Hope that clears things up, feel free to ask about anything if you need further answers :)

I understood Neorg should be the generic format to support basically any notetaking situation. But why then put it into one probably more and more complex plugin and not split it up. Have a basic plugin with just the essential functionality, and then add other plugins with the more fancy stuff. This would not make users hostage of adding new features they are not interested in.

I am not sure if I am the only one, but I just need a simple note taking format with a robust syntax, good syntax highlighting, linking between notes, good native Telescope integration, and nice conceal support. Thats it, all the other fancy things: Don't need it. So testing the limits of whats possible is not one of my requirements :-). Btw before I used Telekasten which can do most of that. Maybe one can support neorg files there.

So thanks for clarifying, I guess Neorg is just not for me. A pity, I liked the syntax. Maybe I fork it ;-), or is there already a fork with less ambitious aims?

flexagoon commented 5 months ago

@moebiusband73

AFAIK Neorg is currently undergoing a refactor and migrating to a client-server architecture, so most of the features will be handled by the Norgopolis server, not the nvim plugin. This means it'll be much easier to build whatever plugin you want on top of norg instead of Neorg

pysan3 commented 5 months ago

@moebiusband73

If you still can't make it to work, paste your error message here. Let's move towards solving the problem and not waste your time writing long comments.

morrismuehl commented 5 months ago

@benlubas

Thanks again, I am not using flakes yet but I might look into it if I find the time.

"Unreliably" meant, sometimes it works, sometimes it doesn't. I can execute commands but markup doesn't work and neither does following links. I can restart nvim and things will probably be fine. Neorg seems to be loaded even if it doesn't work (I can execute neorg commands).

But I am not sure whether that has anything to do with Neorg itself. VimTeX stopped working on me today and all sorts of plugins started misbehaving ever since adopting that config (even just highlighting in *.nix files started becoming super janky). I'll revert to my old config with Neorg 7.0 for now.

LonelyMusicDisc commented 5 months ago

Has anyone gotten luarocks and by extension Neorg working on Windows? I tried to help my friend install it there, but in the end lua-utils is not found got the best of me and I told him to use 7.0.0 instead.

vhyrro commented 5 months ago

@LonelyMusicDisc we've had a decent chunk of windows testers and it should work as expected there. Did your friend have lua installed on their system with something like LuaForWindows as stated in the luarocks.nvim readme?

As always make sure to :Lazy build luarocks.nvim and :Lazy build neorg. I'll try my best to improve the build.lua detection within lazy soon!

vhyrro commented 5 months ago

Thanks again, I am not using flakes yet but I might look into it if I find the time.

"Unreliably" meant, sometimes it works, sometimes it doesn't. I can execute commands but markup doesn't work and neither does following links. I can restart nvim and things will probably be fine. Neorg seems to be loaded even if it doesn't work (I can execute neorg commands).

But I am not sure whether that has anything to do with Neorg itself. VimTeX stopped working on me today and all sorts of plugins started misbehaving ever since adopting that config (even just highlighting in *.nix files started becoming super janky). I'll revert to my old config with Neorg 7.0 for now.

@morrismuehl if you're on the latest neovim nightly releases then I have heard that parts of treesitter have started acting up, do note that just in case.

There's nothing in Neorg that can break only sometimes - our checks either fail completely or don't fail whatsoever. If something fails Neorg will be sure to issue a warning or error message, so be sure to check your error logs! Also, make sure you're on the latest stable release of Neorg and run :checkhealth neorg to see if it has any complaints :)

LonelyMusicDisc commented 5 months ago

So I fixed his install and learned that installing lua-for-windows on scoop does not work the same as installing lua-for-windows normally, do not use scoop!

vhyrro commented 5 months ago

Perhaps winget should be officially recommended in our readme, I recall that working when I was doing tests on a VM :)

tmccombs commented 5 months ago

Is there a way I can use my existing installation of luarocks on my system (archlinux) with lazy.nvim?

Or installing directly with luarocks?

I really don't love the idea of using another plugin that builds a new installation of luarocks when I already have luarocks installed.

And I don't really want to switch to a new package manager either, espeically since rocks.nvim is missiong functionality that lazy.nvim has (such as configuring a plugin to lazily load on certain key mappings or commands, semantic versioning for git repo tags, etc.)

austinbutler commented 5 months ago

What's working for me currently on Nix with home-manager is adding to extraLuaPackages.

  extraLuaPackages = luaPkgs: with luaPkgs; [lua-utils-nvim nvim-nio pathlib-nvim];

Telescope is still half-broken, but I assume that's https://github.com/nvim-neorg/neorg-telescope/issues/57.

maxdiebold commented 5 months ago

@morrismuehl I was able to get rocks working with home-manager by adding luajit (which is for Lua 5.1) to extraPackages, where I had been using the lua package. The lua package is set to a more recent version by default, but overriding the version would probably work, too, e.g. pkgs.lua.override { version = "5.1" };. The neovim home-manager module adds the necessary wrapper arguments to the binary in a similar fashion to @pysan3's tutorial.

Why do the instructions advise setting lazy to false? I have no issues lazy loading, and I'd rather keep it that way, since I obviously won't be using Neorg for non-norg files.

pysan3 commented 5 months ago

Credits to @benlubas for the nix section ;)

@maxdiebold If you lazy load, you cannot get command completions on the first try (like :Neorg togg<tab> won't expand to toggle-concealer). And this is the only downside to lazy loading the plugin so if you always enter a norg file with a keybind etc, you won't notice any problem whatsoever.

However, core devs will only support issues that happen with lazy = false so you will need to fix it on your own if you experience a bug with lazy loading (PR is welcome).

maxdiebold commented 5 months ago

@pysan3 I've found that I can still get the completions on the first try by setting cmd = "Neorg" in Lazy's plugin spec, but I will keep the second point in mind if I run into any issues!

mikolajpp commented 5 months ago

Nothing in this thread or in any resource I found helped me to install on current Lunar Vim stable (Neovim 0.9.0). All attempts failed with lua-utils not found error. Eventually, close to giving up, I decided to install Lunar Vim nightly (Neovim 0.10.0). Apparently there is a (better?) support for luarocks and the installation worked with the stock config!

Anrock commented 5 months ago

Hey there. I've switched from paq to rocks with neorg 8.4.0. Now I have this error when launching neovim

E5113: Error while calling lua chunk: ....1/neorg/modules/core/integrations/treesitter/module.lua:53: Unable to load nvim-
treesitter.ts_utils :(
stack traceback:
        [C]: in function 'assert'
        ....1/neorg/modules/core/integrations/treesitter/module.lua:53: in function 'load'
        ...al/share/nvim/rocks/share/lua/5.1/neorg/core/modules.lua:403: in function 'load_module'
        ...al/share/nvim/rocks/share/lua/5.1/neorg/core/modules.lua:335: in function 'load_module'
        ...ock/.local/share/nvim/rocks/share/lua/5.1/neorg/init.lua:152: in function 'org_file_entered'
        ...ock/.local/share/nvim/rocks/share/lua/5.1/neorg/init.lua:69: in function 'setup'

I also dumped nvim-treesitter in favor of rocks-treesitter.nvim. Is neorg still dependent on nvim-treesitter?

vhyrro commented 5 months ago

@Anrock hey, yes Neorg still relies on treesitter. That was a huge oversight on my part when making the rocks.nvim install instructions, so sorry for that.

With #1390 this will no longer be the case. I hope to merge that later today, just trying to fix some things in the rocks-binaries repo!

bdpierce777 commented 4 months ago

Ok so I fixed it, it just needs 2 dependancies dependencies = { "luarocks.nvim", "nvim-treesitter/nvim-treesitter" }, Everything works now.

This did the trick for me using the "lazy kickstart" The "pure luarocks" config seemed really cool...but I couldn't get it working

arunoruto commented 4 months ago

I currently use nixvim in home-manager to manage my neorg config under nixos, and I always get the following warning:

Warning [neorg]: lua-utils not found. If you're just installing the plugin, ignore this message, when in doubt run `:Lazy build neorg`. If you're not on lazy please rerun the build scripts.

My neorg.nix file looks like this:

{pkgs, ...}: {
  programs.nixvim = {
    plugins = {
      neorg = {
        enable = true;
        modules = {
          "core.defaults".__empty = null;
          "core.concealer" = {
            config = {
              icon_preset = "basic";
            };
          };
          "core.dirman" = {
            config = {
              workspaces = {
                notes = "~/Documents/notes";
              };
              default_workspace = "notes";
            };
          };
        };
      };
    };
    extraLuaPackages = with pkgs.luaPackages; [
      lua-utils-nvim
      nvim-nio
      pathlib-nvim
    ];
  };
}

I followed @austinbutler comment to add the three packages to extraLuaPackages (which is also available in nixvim), but to no avail.

And whenever I am running home-manager switch I get the following warning about treesitter:

warning: Neorg's `core.defaults` module is enabled but `plugins.treesitter` is not.
Treesitter is required when using the `core.defaults`.

Treesitter is for sure enabled and works fine, but something is messed up in nixvim.

clemenscodes commented 3 months ago

@arunoruto I also use nixvim, did not have any luck either using their plugin option. However, I managed to fix it using the official neorg-overlay instead and adding the overridden plugin manually:

{
  pkgs,
  config,
  lib,
  ...
}: let
  cfg = config.nixvim.neorg;
in
  with lib; {
    options = {
      nixvim = {
        neorg = {
          enable = mkEnableOption "Enable neorg for nixvim" // {default = true;};
        };
      };
    };
    config = mkIf (config.nixvim.enable && cfg.enable) {
      programs = {
        nixvim = {
          extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
          extraConfigLuaPost =
            /*
            lua
            */
            ''
              require("neorg").setup {
                load = {
                  ["core.defaults"] = {}
                }
              }
            '';
        };
      };
    };
  }
kjkent commented 3 months ago

First time installing neorg here and I seem to be getting the same issue as a few people in this thread. I followed the instructions for Lazy.nvim and everything appears to install correctly, but every time I start nvim, I get:

Warning [neorg]: lua-utils not found. If you're just installing the plugin, ignore this message, when in
doubt run `:Lazy build neorg`. If you're not on lazy please rerun the build scripts.

:checkhealth neorg reports:

neorg: require("neorg.health").check()

neorg
- Checking configuration...
- OK Empty configuration provided: Neorg will load core.defaults by default.
- Checking existence of dependencies...
- OK Required dependency vhyrro/luarocks found!
- Checking existence of luarocks dependencies...
- ERROR Critical dependency lua-utils.nvim not found! Please run :Lazy build luarocks.nvim and then      :Lazy build neorg! Neorg will refuse to load.

Unfortunately the suggested build commands do not help. I'm running Arch Linux.

pysan3 commented 3 months ago

@kjkent Do you have system dependencies installed?

https://github.com/pysan3/Norg-Tutorial/blob/main/MIGRATION-v8.md#install-system-dependencies

kjkent commented 3 months ago

luajit and lua51? If so, yes, both installed.

Edit for the sake of it, I just cleared my neorg/luarocks files, followed the tutorial again and it worked? I... I don't know. Perhaps I missed a config = true in the plugin definitions. Thank you for your help regardless @pysan3

Mourey commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

clemenscodes commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: https://github.com/nvim-neorg/neorg/issues/1342#issuecomment-2137724840

Mourey commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: #1342 (comment)

I don't quite follow your solution, adding your configuration is not really working for me

`
error: attribute 'enable' missing

   at /nix/store/sdnwlvck6a2l6lvl7q9chsqv4m737wjn-source/homeManagerModules/neo.nix:17:20:

       16|     };
       17|     config = mkIf (config.nixvim.enable && cfg.enable) {
         |                    ^
       18|       programs = {

`

clemenscodes commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: #1342 (comment)

I don't quite follow your solution, adding your configuration is not really working for me

` error: attribute 'enable' missing

   at /nix/store/sdnwlvck6a2l6lvl7q9chsqv4m737wjn-source/homeManagerModules/neo.nix:17:20:

       16|     };
       17|     config = mkIf (config.nixvim.enable && cfg.enable) {
         |                    ^
       18|       programs = {

`

This is a minimal module without custom options:

{pkgs, ...}: {
  programs = {
    nixvim = {
      enable = true;
      extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
      extraConfigLuaPost = ''
        require("neorg").setup {
          load = {
            ["core.defaults"] = {},
          },
        }
      '';
    };
  };
}

Note that this uses the mentioned overlay. To use it, you have to first be using flakes, and then add it as a flake input in your flake.nix and add the overlay to the overlays of your nixpkgs. The link gives an example on how to do that.

Mourey commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: #1342 (comment)

I don't quite follow your solution, adding your configuration is not really working for me ` error: attribute 'enable' missing

   at /nix/store/sdnwlvck6a2l6lvl7q9chsqv4m737wjn-source/homeManagerModules/neo.nix:17:20:

       16|     };
       17|     config = mkIf (config.nixvim.enable && cfg.enable) {
         |                    ^
       18|       programs = {

`

This is a minimal module without custom options:

{pkgs, ...}: {
  programs = {
    nixvim = {
      enable = true;
      extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
      extraConfigLuaPost = ''
        require("neorg").setup {
          load = {
            ["core.defaults"] = {},
          },
        }
      '';
    };
  };
}

Note that this uses the mentioned overlay. To use it, you have to first be using flakes, and then add it as a flake input in your flake.nix and add the overlay to the overlays of your nixpkgs. The link gives an example on how to do that.

Thank you for your support and help, you helped me learn something new. I was not aware that under a home-manager set up I had to import the overlay directly on my home.nix ( my file structure is something like: flake.nix that imports configuration.nix (os) and in turn configuration.nix imports home.nix (home-manager)).

In essence by adding the overlay to home-manager solved the issue and I now have Neorg in my Nixvim configuration using the overlay!

Thank you!

clemenscodes commented 3 months ago

Hi If anyone has managed to get it to work on Nixvim, would appreciate comments on how the managed it!

See here: #1342 (comment)

I don't quite follow your solution, adding your configuration is not really working for me ` error: attribute 'enable' missing

   at /nix/store/sdnwlvck6a2l6lvl7q9chsqv4m737wjn-source/homeManagerModules/neo.nix:17:20:

       16|     };
       17|     config = mkIf (config.nixvim.enable && cfg.enable) {
         |                    ^
       18|       programs = {

`

This is a minimal module without custom options:

{pkgs, ...}: {
  programs = {
    nixvim = {
      enable = true;
      extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
      extraConfigLuaPost = ''
        require("neorg").setup {
          load = {
            ["core.defaults"] = {},
          },
        }
      '';
    };
  };
}

Note that this uses the mentioned overlay. To use it, you have to first be using flakes, and then add it as a flake input in your flake.nix and add the overlay to the overlays of your nixpkgs. The link gives an example on how to do that.

Thank you for your support and help, you helped me learn something new. I was not aware that under a home-manager set up I had to import the overlay directly on my home.nix ( my file structure is something like: flake.nix that imports configuration.nix (os) and in turn configuration.nix imports home.nix (home-manager)).

In essence by adding the overlay to home-manager solved the issue and I now have Neorg in my Nixvim configuration using the overlay!

Thank you!

Yeah, you can either import the overlay in flake.nix and pass your pkgs instance as extraSpecialArgs to home-manager, or use the overlay directly in home-manager. Glad I could help!

sij1nk commented 3 months ago

https://github.com/nvim-neorg/neorg/issues/1342#issuecomment-2024108469

It turns out that if anything is "wrong" with wget, the Neorg build process (e.g. as invoked through :Lazy build neorg) dies, like in the linked comment above. In my case, after I transferred some dotfiles from another machine, my WGETRC environment variable was (mistakenly) pointed to a file which didn't exist, and wget failed with the following error:

wget: WGETRC points to /home/rg/does-not-exist, which couldn't be accessed because of error: No such file or directory.

Fixing up the WGETRC env var to point to a valid wgetrc file cured my wget, and installing Neorg worked fine afterwards

edit: I noticed kinda late that wget issues already popped up for some other people in this thread, and the migration guide also mentions it, so I guess I said nothing new :D

TLSingh1 commented 2 months ago

@arunoruto I also use nixvim, did not have any luck either using their plugin option. However, I managed to fix it using the official neorg-overlay instead and adding the overridden plugin manually:

{
  pkgs,
  config,
  lib,
  ...
}: let
  cfg = config.nixvim.neorg;
in
  with lib; {
    options = {
      nixvim = {
        neorg = {
          enable = mkEnableOption "Enable neorg for nixvim" // {default = true;};
        };
      };
    };
    config = mkIf (config.nixvim.enable && cfg.enable) {
      programs = {
        nixvim = {
          extraPlugins = with pkgs.vimPlugins; [neorg neorg-telescope];
          extraConfigLuaPost =
            /*
            lua
            */
            ''
              require("neorg").setup {
                load = {
                  ["core.defaults"] = {}
                }
              }
            '';
        };
      };
    };
  }

This works!! if on nixos, using flakes and home-manager, this solved my issues.

sbaumohl commented 2 months ago

After following all steps and troubleshooting steps, and rebuilding neorg multiple times, I keep having this error on checkhealth:

[neorg] (01:32:02)
.../.local/share/nvim/lazy/neorg/lua/neorg/core/modules.lua:449
Unable to load module 'core.neorg.dirman'. The module probably does not exist! Stacktrace:  module 'neorg.modules.core.neorg.dirman.module' not found:No LuaRocks module found for neorg.mod
ules.core.neorg.dirman.module
^Ino field package.preload['neorg.modules.core.neorg.dirman.module']
cache_loader: module neorg.modules.core.neorg.dirman.module not found
cache_loader_lib: module neorg.modules.core.neorg.dirman.module not found
^Ino file './neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/usr/local/share/lua/5.1/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/usr/local/share/lua/5.1/neorg/modules/core/neorg/dirman/module/init.lua'
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/neorg/modules/core/neorg/dirman/module/init.lua'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/share/lua/5.1/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/share/lua/5.1/neorg/modules/core/neorg/dirman/module/init.lua'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/lua/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/lua/neorg/modules/core/neorg/dirman/module/init.lua'
^Ino file '/home/USER/.luarocks/share/lua/5.1/neorg/modules/core/neorg/dirman/module.lua'
^Ino file '/home/USER/.luarocks/share/lua/5.1/neorg/modules/core/neorg/dirman/module/init.lua'
^Ino file './neorg/modules/core/neorg/dirman/module.so'
^Ino file '/usr/local/lib/lua/5.1/neorg/modules/core/neorg/dirman/module.so'
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/neorg/modules/core/neorg/dirman/module.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/lib/lua/5.1/neorg/modules/core/neorg/dirman/module.so'
^Ino file '/home/USER/.luarocks/lib/lua/5.1/neorg/modules/core/neorg/dirman/module.so'
^Ino file './neorg.so'
^Ino file '/usr/local/lib/lua/5.1/neorg.so'
^Ino file '/home/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/neorg.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file '/home/USER/.local/share/nvim/lazy/luarocks.nvim/.rocks/lib/lua/5.1/neorg.so'
^Ino file '/home/USER/.luarocks/lib/lua/5.1/neorg.so'                                                                                      

luarocks.nvim is installed correctly, and returns positively on a :checkhealth

benlubas commented 2 months ago

@sbaumohl

After following all steps and troubleshooting steps, and rebuilding neorg multiple times, I keep having this error on checkhealth:

b/c core.neorg.dirman doesn't exist. It's core.dirman

sbaumohl commented 2 months ago

@sbaumohl

After following all steps and troubleshooting steps, and rebuilding neorg multiple times, I keep having this error on checkhealth:

b/c core.neorg.dirman doesn't exist. It's core.dirman

Right. Which is odd because this is my config:

        {
                "nvim-neorg/neorg",
                dependencies = { "luarocks.nvim", "nvim-treesitter/nvim-treesitter" },
                lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
                version = "*",
                after = "nvim-treesitter",
                config = function()
                        require("neorg").setup({
                                load = {
                                        ["core.defaults"] = {},
                                        ["core.dirman"] = {
                                                config = {
                                                        workspaces = {
                                                                notes = "~/notes",
                                                        },
                                                        index = "index.norg",
                                                },
                                        },
                                },
                        })
                end,
        },