-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
vimPlugins: make usage of luaPackages less confusing #195732
Conversation
Before the PR, on current master for instance, the src from vim/generated.nix is ignored, e.g.:
with this PR, the source overrides the lua package src and also updates its version/name (I introduced a rockspecVersion field to keep track of the original rockspec name and still be able to find it in the src).
^ notice how the name changes. I was able to rebuild on master. Was not able to test on staging. |
pkgs/top-level/all-packages.nix
Outdated
@@ -32247,7 +32247,7 @@ with pkgs; | |||
}; | |||
|
|||
neovimUtils = callPackage ../applications/editors/neovim/utils.nix { | |||
inherit (lua51Packages) buildLuarocksPackage; | |||
lua = lua5_1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lua = lua5_1; | |
lua = luajit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should actually be neovim-unwrapped.lua but it just changes which version of luarocks you are going to use to install the packages so I would rather not change it for now to avoid breakage. What matters is the version of lua run by neovim, which is actually luajit so perfs are still the best
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-do-i-get-nvim-cmp-working-in-neovim/22398/2 |
right now the src is ignored in: ``` lush-nvim = buildNeovimPlugin { pname = "lush.nvim"; version = "2022-08-09"; src = fetchFromGitHub { owner = "rktjmp"; repo = "lush.nvim"; rev = "6b9f399245de7bea8dac2c3bf91096ffdedfcbb7"; sha256 = "0rb77rwmbm438bmbjfk5hwrrcn5sihsa1413bdpc27rw3rrn8v8z"; }; meta.homepage = "https://github.com/rktjmp/lush.nvim/"; }; ``` which is very confusing. With this PR, we correctly override the src and the version of the package. We introduce a rockspecVersion attribute of lua package to be able to still find the rockspec when the "version" field needs to be different than "rockspecVersion".
91a3f1a
to
d2a35ab
Compare
Tested against staging (cmp-buffer failing) (here directly against this PR, cachix error) the underlying issue still seems to exist. |
@573 could you come up with a test either in pkgs/applications/editors/vim/plugins/overrides.nix for nvim-cmp. I am using nvim-cmp on unstable (slighlty modified) without any issue (but not cmp-buffer). |
@teto IDK how to do that properly, would love to contribute if I knew how. I'm running (link above) a github action. It might be that I'm confusing the possible approaches how to set up neovim with configuration that exist... Also I'm taking the neovim itself I do install via home-manager as in programs.neovim = {
enable = true;
package = pkgs.neovim;
# and so on
}; I have a gut feeling that this is where it all goes wrong in the end, but I'm looking forward to learn about an approach that stays close to nixpkgs. |
To clarify, when I just override unstable neovim like in this code using it in my packages list as to be seen here I get at least v0.8 neovim with the cmp* plugins I wish to use as of currently. How to now use the neovim-nightly provided by neovim-nightly-overlay is obviously (now for me) another topic, sorry for the noise. |
Fixes #185397
right now the src is ignored in:
which is very confusing. With this PR, we correctly override the src and the version of the package. We introduce a rockspecVersion attribute of lua package to be able to still find the rockspec when the "version" field needs to be different than "rockspecVersion".
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes