oxalica / nil

NIx Language server, an incremental analysis assistant for writing in Nix.
Apache License 2.0
1.32k stars 39 forks source link

Don't look for NixOS options when module-list.nix or lib doesn't exist #80

Closed figsoda closed 1 year ago

figsoda commented 1 year ago

so nil doesn't output an error when with something like this: inputs.nixpkgs.url = "github:nix-community/nixpkgs.lib";

oxalica commented 1 year ago

Could we rely on the .version file? Seems lib.trivial.release is just reading this file.

figsoda commented 1 year ago

To replace builtins.compareVersions trivial.release "22.11" >= 0? I would say yes

Though this wouldn't be the only thing I rely on since it is a popular file name: https://github.com/search?q=path%3A%2F%5E%5C.version%24%2F&type=code I think having both .version and nixos/modules/module-list.nix would be a fairly safe bet

oxalica commented 1 year ago

I also made the input name of nixpkgs used for options configurable in 21d0870aaba406c41acaf602ce59d000fba7a27c