File tree Expand file tree Collapse file tree 3 files changed +51
-67
lines changed
plugins/lsp/language-servers Expand file tree Collapse file tree 3 files changed +51
-67
lines changed Original file line number Diff line number Diff line change 4
4
config ,
5
5
pkgs ,
6
6
...
7
- } @ args :
7
+ } :
8
8
with lib ;
9
9
let
10
- nixdSettings = import ./nixd.nix args ;
11
-
12
10
servers = [
13
11
{
14
12
name = "ansiblels" ;
408
406
description = "nixd for Nix" ;
409
407
package = pkgs . nixd ;
410
408
settings = cfg : { nixd = cfg ; } ;
411
- settingsOptions = nixdSettings . options ;
409
+ settingsOptions = import ./nixd-settings.nix { inherit lib helpers ; } ;
410
+ extraConfig = cfg : {
411
+ extraPackages = optional ( cfg . settings . formatting . command == [ "nixpkgs-fmt" ] ) pkgs . nixpkgs-fmt ;
412
+ } ;
412
413
}
413
414
{
414
415
name = "nushell" ;
683
684
./rust-analyzer.nix
684
685
./svelte.nix
685
686
] ;
686
-
687
- config = lib . mkMerge [ nixdSettings . config ] ;
688
687
}
Original file line number Diff line number Diff line change
1
+ { lib , helpers } :
2
+ # Options:
3
+ # - https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md
4
+ # - https://github.com/nix-community/nixd/blob/main/nixd/include/nixd/Controller/Configuration.h
5
+ with lib ;
6
+ {
7
+ formatting = {
8
+ command = helpers . defaultNullOpts . mkListOf types . str ''[ "nixpkgs-fmt" ]'' ''
9
+ Which command you would like to do formatting.
10
+ Explicitly set to `["nixpkgs-fmt"]` will automatically add `pkgs.nixpkgs-fmt` to the nixvim
11
+ environment.
12
+ '' ;
13
+ } ;
14
+
15
+ options =
16
+ let
17
+ provider = types . submodule {
18
+ options = {
19
+ expr = mkOption {
20
+ type = types . str ;
21
+ description = "Expression to eval. Select this attrset as eval .options" ;
22
+ } ;
23
+ } ;
24
+ } ;
25
+ in
26
+ helpers . mkNullOrOption ( with helpers . nixvimTypes ; attrsOf ( maybeRaw provider ) ) ''
27
+ Tell the language server your desired option set, for completion.
28
+ This is lazily evaluated.
29
+ '' ;
30
+
31
+ nixpkgs =
32
+ let
33
+ provider = types . submodule {
34
+ options = {
35
+ expr = mkOption {
36
+ type = types . str ;
37
+ description = "Expression to eval. Treat it as `import <nixpkgs> { }`" ;
38
+ } ;
39
+ } ;
40
+ } ;
41
+ in
42
+ helpers . mkNullOrOption ( helpers . nixvimTypes . maybeRaw provider ) ''
43
+ This expression will be interpreted as "nixpkgs" toplevel
44
+ Nixd provides package, lib completion/information from it.
45
+ '' ;
46
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments