-
-
Notifications
You must be signed in to change notification settings - Fork 250
/
nil-ls-settings.nix
88 lines (75 loc) · 2.81 KB
/
nil-ls-settings.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
{ lib, helpers }:
# All available settings are documented here:
# https://github.com/oxalica/nil/blob/main/docs/configuration.md
with lib;
{
formatting = {
command = helpers.defaultNullOpts.mkListOf' {
type = types.str;
pluginDefault = null;
description = ''
External formatting command, complete with required arguments.
It should accept file content from stdin and print the formatted code to stdout.
'';
example = [ "nixpkgs-fmt" ];
};
};
diagnostics = {
ignored = helpers.defaultNullOpts.mkListOf types.str [ ] ''
Ignored diagnostic kinds.
The kind identifier is a snake_cased_string usually shown together
with the diagnostic message.
'';
excludedFiles = helpers.defaultNullOpts.mkListOf' {
type = types.str;
pluginDefault = [ ];
description = ''
Files to exclude from showing diagnostics. Useful for generated files.
It accepts an array of paths. Relative paths are joint to the workspace root.
Glob patterns are currently not supported.
'';
example = [ "Cargo.nix" ];
};
};
nix = {
binary = helpers.defaultNullOpts.mkStr' {
pluginDefault = "nix";
description = "The path to the `nix` binary.";
example = "/run/current-system/sw/bin/nix";
};
maxMemoryMB = helpers.defaultNullOpts.mkUnsignedInt' {
pluginDefault = 2560;
example = 1024;
description = ''
The heap memory limit in MiB for `nix` evaluation.
Currently it only applies to flake evaluation when `autoEvalInputs` is enabled, and only works
for Linux.
Other `nix` invocations may be also applied in the future.
`null` means no limit.
As a reference, `nix flake show --legacy nixpkgs` usually requires about 2GiB memory.
'';
};
flake = {
autoArchive = helpers.defaultNullOpts.mkBool false ''
Auto-archiving behavior which may use network.
- `null`: Ask every time.
- `true`: Automatically run `nix flake archive` when necessary.
- `false`: Do not archive. Only load inputs that are already on disk.
'';
autoEvalInputs = helpers.defaultNullOpts.mkBool false ''
Whether to auto-eval flake inputs.
The evaluation result is used to improve completion, but may cost lots of time and/or memory.
'';
nixpkgsInputName = helpers.defaultNullOpts.mkStr' {
pluginDefault = "nixpkgs";
example = "nixos";
description = ''
The input name of nixpkgs for NixOS options evaluation.
The options hierarchy is used to improve completion, but may cost lots of time and/or memory.
If this value is `null` or is not found in the workspace flake's inputs, NixOS options are
not evaluated.
'';
};
};
};
}