-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
update-scripts: Add a script to search for nvim-lspconfig server packages #2393
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,66 @@ | |||
#!/usr/bin/env python3 | |||
# This script requires nix-locate |
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.
should this be a nix shebang with nix-locate included?
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'm not sure, I think nix-locate needs a nix-index database to be installzd
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.
Oh, that sounds right... I think that's why I ended up adding nix-index-database to my flake.
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 could add a dependency on https://github.com/nix-community/nix-index-database for this, but it's maybe a bit heavy?
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.
Yeah, I don't know if it's worth an extra input.
@@ -13,6 +13,7 @@ | |||
}: | |||
lib.optionalAttrs (inputs.devshell ? flakeModule) { | |||
devshells.default = { | |||
packages = [ pkgs.python3 ]; |
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.
or included in here?
While working on #2399 it might be nice if we can use the script to check for whether a match exists, if it doesn't automatically add it to the unpackaged list in lsp-packages.nix to make this fully automated.. |
Well this is the use of this script, to help search for the corresponding nixkpkgs package |
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.
Don't see any issues, though I don't fully understand all design decisions.
@@ -13,6 +13,7 @@ | |||
}: | |||
lib.optionalAttrs (inputs.devshell ? flakeModule) { | |||
devshells.default = { | |||
packages = [ pkgs.python3 ]; |
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.
Any reason why you're adding python to the devshell instead of packaging your script as a derivation (like we normally do)?
import os | ||
import subprocess | ||
|
||
repo = os.path.realpath(os.path.dirname(__file__) + "/../..") |
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.
Maybe this is why? I think there'd still be work-arounds, such as providing the relevant files at the CLI or via env vars. These could then be made available to the script via a wrapper or a patch/fixup phase in the drv builder.
@traxys friendly bump 🙂 |
This script generates a list on stdout of possible matches for nvim-lspconfig servers.
It can't easily generate something more advanced because a lot of lsp servers have false positives, for example groovy's default command is
java -jar .....
, this would match thejava
package, not the groovy language server.