-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
buildNeovimPlugin: pass a derivation to luaAttr #343564
Conversation
and deprecate passing a string. Passing a string is not a typical/good nixpkgs habit. We want to give more control on which attribute to wrap, without having to add it to the lua package set necessarily.
buildNeovimPlugin now accepts derivations instead of the lua package name. This PR reflects the change
Passed nixpkgs-review
|
, ... | ||
}@attrs: | ||
let | ||
originalLuaDrv = lua.pkgs.${luaAttr}; | ||
# warning added Sep 2024 | ||
originalLuaDrv = lib.warnIf (lib.typeOf luaAttr == "string") "luaAttr as string is deprecated. Pass a lua derivation directly ( e.g., `buildNeovimPlugin { luaAttr = lua.pkgs.plenary-nvim; }`)" luaAttr; |
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.
issue: a deprecation causes a warning to be printed, but still works.
This is a breaking change, because passing in a string is no longer possible.
This should either use lib.throwIf
(with the wording "no longer supported" instead of "deprecated" or it should use lib.warnIf
and fall back to lua.pkgs.${luaAttr}
.
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.
indeed. I've converted it into an if/else in a followup commit and tested with luaAttr = "haskell-tools.nvim". If that's good for you. I'll squash on merge .
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 had to restore the default for luaAttr else the plugins in vim/generated.nix
would fail to eval. So if you dont set pname and luaAttr the eval will fail. I preferred to do that since the handling of vim/generated.nix will change one way or another.
(my first take is #342884 but I dont like adding yet another updater so hopefully we can do better)
c16a3b1
to
aee184b
Compare
this passes nixpkgs-review here. Merging |
and deprecate passing a string.
Passing a string is not a typical/good nixpkgs habit. We want to give more control on
which attribute to wrap, without having to add it to the lua package set
necessarily.
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.