Skip to content

Commit 09dfa03

Browse files
GaetanLepagenix-infra-bot
authored andcommitted
plugins/gitlab: init
1 parent 880a570 commit 09dfa03

File tree

2 files changed

+215
-0
lines changed

2 files changed

+215
-0
lines changed

plugins/by-name/gitlab/default.nix

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
{
2+
lib,
3+
pkgs,
4+
...
5+
}:
6+
let
7+
inherit (lib.nixvim) defaultNullOpts;
8+
inherit (lib) types;
9+
in
10+
lib.nixvim.neovim-plugin.mkNeovimPlugin {
11+
name = "gitlab";
12+
originalName = "gitlab.vim";
13+
package = "gitlab-vim";
14+
15+
maintainers = [ lib.maintainers.GaetanLepage ];
16+
17+
extraOptions = {
18+
nodePackage = lib.mkPackageOption pkgs "nodejs" {
19+
nullable = true;
20+
default = null;
21+
};
22+
};
23+
24+
extraConfig = cfg: {
25+
extraPackages = [ cfg.nodePackage ];
26+
};
27+
28+
settingsOptions = {
29+
gitlab_url = defaultNullOpts.mkStr "https://gitlab.com" ''
30+
The GitLab instance url to use if not `https://gitlab.com`.
31+
'';
32+
33+
statuslines = {
34+
enable = defaultNullOpts.mkBool true ''
35+
Whether to enable statuslines.
36+
'';
37+
};
38+
39+
resource_editing = {
40+
enable = defaultNullOpts.mkBool false ''
41+
Whether to enable resource editing.
42+
'';
43+
};
44+
45+
minimal_message_level = defaultNullOpts.mkUnsignedInt 0 ''
46+
Minimal message level for logs.
47+
'';
48+
49+
code_suggestions = {
50+
auto_filetypes =
51+
defaultNullOpts.mkListOf types.str
52+
[
53+
"c"
54+
"cpp"
55+
"csharp"
56+
"go"
57+
"java"
58+
"javascript"
59+
"javascriptreact"
60+
"kotlin"
61+
"markdown"
62+
"objective-c"
63+
"objective-cpp"
64+
"php"
65+
"python"
66+
"ruby"
67+
"rust"
68+
"scala"
69+
"sql"
70+
"swift"
71+
"terraform"
72+
"typescript"
73+
"typescriptreact"
74+
"sh"
75+
"html"
76+
"css"
77+
]
78+
''
79+
Filetypes to automatically invoke `|gitlab.code_suggestions.start()|`.
80+
'';
81+
82+
enabled = defaultNullOpts.mkBool true ''
83+
Whether to enable `|gitlab-code-suggestions|` via the LSP binary.
84+
'';
85+
86+
fix_newlines = defaultNullOpts.mkBool true ''
87+
Whether to replace newlines that have become null-byte due to switching between encodings.
88+
'';
89+
90+
lsp_binary_path = defaultNullOpts.mkStr' {
91+
pluginDefault = "node";
92+
example = lib.literalExpression "lib.getExe pkgs.nodejs";
93+
description = ''
94+
The path where the `node` executable is available.
95+
96+
By default, this option is set to `"node"` which will look for nodejs in your `$PATH`.
97+
To ensure that `node` will always be in your `$PATH`, you may set the `nodePackage` option.
98+
99+
Alternatively, you can set this option to `lib.getExe pkgs.nodejs` (or any other package).
100+
'';
101+
};
102+
103+
offset_encoding = defaultNullOpts.mkStr "utf-16" ''
104+
Which offset encoding to use.
105+
'';
106+
107+
redact_secrets = defaultNullOpts.mkBool true ''
108+
Whether to redact secrets.
109+
'';
110+
};
111+
112+
language_server = {
113+
workspace_settings = {
114+
codeCompletion = {
115+
enableSecretRedaction = defaultNullOpts.mkBool true ''
116+
Whether to enable secret redactions in completion.
117+
'';
118+
};
119+
telemetry = {
120+
enabled = defaultNullOpts.mkBool true ''
121+
Whether to enable telemetry.
122+
'';
123+
124+
trackingUrl = defaultNullOpts.mkStr null ''
125+
URL of the telemetry service.
126+
'';
127+
};
128+
};
129+
};
130+
};
131+
132+
settingsExample = {
133+
code_suggestions = {
134+
auto_filetypes = [ "ruby" ];
135+
};
136+
};
137+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
empty = {
3+
plugins.gitlab.enable = true;
4+
};
5+
6+
defaults = {
7+
plugins.gitlab = {
8+
enable = true;
9+
10+
settings = {
11+
gitlab_url = "https://gitlab.com";
12+
statuslines = {
13+
enable = true;
14+
};
15+
resource_editing = {
16+
enable = false;
17+
};
18+
minimal_message_level = 0;
19+
code_suggestions = {
20+
auto_filetypes = [
21+
"c"
22+
"cpp"
23+
"csharp"
24+
"go"
25+
"java"
26+
"javascript"
27+
"javascriptreact"
28+
"kotlin"
29+
"markdown"
30+
"objective-c"
31+
"objective-cpp"
32+
"php"
33+
"python"
34+
"ruby"
35+
"rust"
36+
"scala"
37+
"sql"
38+
"swift"
39+
"terraform"
40+
"typescript"
41+
"typescriptreact"
42+
"sh"
43+
"html"
44+
"css"
45+
];
46+
enabled = true;
47+
fix_newlines = true;
48+
lsp_binary_path = "node";
49+
offset_encoding = "utf-16";
50+
redact_secrets = true;
51+
};
52+
language_server = {
53+
workspace_settings = {
54+
codeCompletion = {
55+
enableSecretRedaction = true;
56+
};
57+
telemetry = {
58+
enabled = true;
59+
trackingUrl = null;
60+
};
61+
};
62+
};
63+
};
64+
};
65+
};
66+
67+
example = {
68+
plugins.gitlab = {
69+
enable = true;
70+
71+
settings = {
72+
code_suggestions = {
73+
auto_filetypes = [ "ruby" ];
74+
};
75+
};
76+
};
77+
};
78+
}

0 commit comments

Comments
 (0)