File tree Expand file tree Collapse file tree 14 files changed +96
-106
lines changed
tiny-devicons-auto-colors Expand file tree Collapse file tree 14 files changed +96
-106
lines changed Original file line number Diff line number Diff line change @@ -176,15 +176,13 @@ lib.nixvim.plugins.mkNeovimPlugin {
176
176
} ;
177
177
178
178
extraConfig = {
179
- assertions = [
180
- {
181
- assertion = ! config . plugins . copilot-vim . enable ;
182
- message = ''
183
- You currently have both `copilot-vim` and `copilot-lua` enabled.
184
- Please disable one of them.
185
- '' ;
186
- }
187
- ] ;
179
+ assertions = lib . nixvim . mkAssertions "plugins.copilot-lua" {
180
+ assertion = ! config . plugins . copilot-vim . enable ;
181
+ message = ''
182
+ You currently have both `copilot-vim` and `copilot-lua` enabled.
183
+ Please disable one of them.
184
+ '' ;
185
+ } ;
188
186
} ;
189
187
190
188
# TODO: introduced 2025-01-07: remove after 25.05
Original file line number Diff line number Diff line change @@ -59,12 +59,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
59
59
extraConfig =
60
60
cfg :
61
61
lib . mkIf cfg . enable {
62
- assertions = [
63
- {
64
- assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
65
- message = ''Nixvim: The git-worktree telescope integration needs telescope to function as intended'' ;
66
- }
67
- ] ;
62
+ assertions = lib . nixvim . mkAssertions "plugins.git-worktree" {
63
+ assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
64
+ message = ''
65
+ You have to enable `plugins. telescope` as `enableTelescope` is activated.
66
+ '' ;
67
+ } ;
68
68
69
69
extraPackages = [ cfg . gitPackage ] ;
70
70
Original file line number Diff line number Diff line change 191
191
// cfg . extraOptions ;
192
192
in
193
193
mkIf cfg . enable {
194
- assertions = [
194
+ assertions = lib . nixvim . mkAssertions "plugins.harpoon" [
195
195
{
196
196
assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
197
- message = ''Nixvim: The harpoon telescope integration needs telescope to function as intended'' ;
197
+ message = " The harpoon telescope integration needs telescope to function as intended." ;
198
198
}
199
199
] ;
200
200
Original file line number Diff line number Diff line change 231
231
config = mkIf cfg . enable {
232
232
extraPlugins = [ cfg . package ] ;
233
233
234
- assertions = [
235
- {
236
- assertion =
237
- ! (
238
- # leanls lsp server is disabled in nvim-lspconfig
239
- config . plugins . lsp . servers . leanls . enable
240
- # lsp is not (!) disabled in the lean.nvim plugin
241
- && ! (
242
- # lsp is explicitly set to `false`.
243
- ( isBool cfg . lsp . enable ) && ! cfg . lsp . enable
244
- )
245
- ) ;
246
- message = ''
247
- You have not explicitly set `plugins.lean.lsp` to `false` while having `plugins.lsp.servers.leanls.enable` set to `true`.
248
- You need to either
249
-
250
- - Remove the configuration in `plugins.lsp.servers.leanls` and move it to `plugins.lean.lsp`.
251
- - Explicitly disable the autoconfiguration of the lsp in the lean.nvim plugin by setting `plugins.lean.lsp` to `false`.
252
-
253
- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls
254
- '' ;
255
- }
256
- ] ;
234
+ assertions = lib . nixvim . mkAssertions "plugins.lean" {
235
+ assertion =
236
+ ! (
237
+ # leanls lsp server is disabled in nvim-lspconfig
238
+ config . plugins . lsp . servers . leanls . enable
239
+ # lsp is not (!) disabled in the lean.nvim plugin
240
+ && ! (
241
+ # lsp is explicitly set to `false`.
242
+ ( isBool cfg . lsp . enable ) && ! cfg . lsp . enable
243
+ )
244
+ ) ;
245
+ message = ''
246
+ You have not explicitly set `plugins.lean.lsp` to `false` while having `plugins.lsp.servers.leanls.enable` set to `true`.
247
+ You need to either
248
+
249
+ - Remove the configuration in `plugins.lsp.servers.leanls` and move it to `plugins.lean.lsp`.
250
+ - Explicitly disable the autoconfiguration of the lsp in the lean.nvim plugin by setting `plugins.lean.lsp` to `false`.
251
+
252
+ https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls
253
+ '' ;
254
+ } ;
257
255
258
256
extraPackages = [ cfg . leanPackage ] ;
259
257
Original file line number Diff line number Diff line change @@ -94,15 +94,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
94
94
callSetup = false ;
95
95
hasSettings = false ;
96
96
extraConfig = cfg : {
97
- assertions = [
98
- {
99
- assertion = cfg . mockDevIcons -> cfg . modules ? icons ;
100
- message = ''
101
- You have enabled `plugins.mini.mockDevIcons` but have not defined `plugins.mini.modules.icons`.
102
- This setting will have no effect without it.
103
- '' ;
104
- }
105
- ] ;
97
+ assertions = lib . nixvim . mkAssertions "pluhins.mini" {
98
+ assertion = cfg . mockDevIcons -> cfg . modules ? icons ;
99
+ message = ''
100
+ You have enabled `plugins.mini.mockDevIcons` but have not defined `plugins.mini.modules.icons`.
101
+ This setting will have no effect without it.
102
+ '' ;
103
+ } ;
104
+
106
105
plugins . mini . luaConfig . content =
107
106
lib . foldlAttrs ( lines : name : config : ''
108
107
${ lines }
Original file line number Diff line number Diff line change 37
37
mkIf cfg . enable {
38
38
extraPlugins = [ cfg . package ] ;
39
39
40
- assertions = [
41
- {
42
- assertion = config . plugins . neotest . enable ;
43
- message = "Nixvim: you have enabled `plugins.neotest.adapters. ${ name } ` but `plugins.neotest.enable ` is `false`." ;
44
- }
45
- ] ;
40
+ assertions = lib . nixvim . mkAssertions "plugins.neotest.adapters. ${ name } " {
41
+ assertion = config . plugins . neotest . enable ;
42
+ message = ''
43
+ You have to enable `plugins.telescope` as `enableTelescope ` is activated.
44
+ '' ;
45
+ } ;
46
46
47
47
warnings = lib . nixvim . mkWarnings "plugins.neotest.adapters.${ name } " {
48
48
when = ! config . plugins . treesitter . enable ;
Original file line number Diff line number Diff line change @@ -137,17 +137,16 @@ lib.nixvim.plugins.mkNeovimPlugin {
137
137
'' ;
138
138
} ;
139
139
140
- assertions = [
141
- {
142
- assertion = cfg . enableLspFormat -> config . plugins . lsp-format . enable ;
143
- message = ''
144
- Nixvim: You have enabled the lsp-format integration with none-ls.
145
- However, you have not enabled `plugins.lsp-format` itself.
146
- Note: `plugins.none-ls.enableLspFormat` is enabled by default when `plugins.lsp-format` is enabled.
147
- `plugins.none-ls.enableLspFormat` definitions: ${ lib . options . showDefs options . plugins . none-ls . enableLspFormat . definitionsWithLocations }
148
- '' ;
149
- }
150
- ] ;
140
+ assertions = lib . nixvim . mkAssertions "plugins.none-ls" {
141
+ assertion = cfg . enableLspFormat -> config . plugins . lsp-format . enable ;
142
+
143
+ message = ''
144
+ You have enabled the lsp-format integration with none-ls.
145
+ However, you have not enabled `plugins.lsp-format` itself.
146
+ Note: `plugins.none-ls.enableLspFormat` is enabled by default when `plugins.lsp-format` is enabled.
147
+ `plugins.none-ls.enableLspFormat` definitions: ${ lib . options . showDefs options . plugins . none-ls . enableLspFormat . definitionsWithLocations }
148
+ '' ;
149
+ } ;
151
150
152
151
# We only do this here because of enableLspFormat
153
152
plugins . none-ls . luaConfig . content = ''
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
111
111
assertions = lib . nixvim . mkAssertions "plugins.package-info" {
112
112
assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
113
113
message = ''
114
- The telescope integration needs telescope to function as intended .
114
+ You have to enable `plugins. telescope` as `enableTelescope` is activated .
115
115
'' ;
116
116
} ;
117
117
Original file line number Diff line number Diff line change @@ -119,16 +119,15 @@ with lib;
119
119
when = ! config . plugins . treesitter . enable ;
120
120
message = "This plugin needs treesitter to function as intended." ;
121
121
} ;
122
- assertions = [
123
- {
124
- assertion = ( cfg . whitelist == null ) || ( cfg . blacklist == null ) ;
125
- message = ''
126
- Both `rainbow-delimiters.whitelist` and `rainbow-delimiters.blacklist` should not be
127
- set simultaneously.
128
- Please remove one of them.
129
- '' ;
130
- }
131
- ] ;
122
+ assertions = lib . nixvim . mkAssertions "plugins.rainbow-delimiters" {
123
+ assertion = ( cfg . whitelist == null ) || ( cfg . blacklist == null ) ;
124
+
125
+ message = ''
126
+ Both `rainbow-delimiters.whitelist` and `rainbow-delimiters.blacklist` should not be
127
+ set simultaneously.
128
+ Please remove one of them.
129
+ '' ;
130
+ } ;
132
131
133
132
extraPlugins = [ cfg . package ] ;
134
133
Original file line number Diff line number Diff line change @@ -26,15 +26,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
26
26
} ;
27
27
28
28
extraConfig = cfg : {
29
- assertions = [
30
- {
31
- assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
32
- message = ''
33
- Nixvim: You have enabled the `telescope` integration with refactoring-nvim.
34
- However, you have not enabled the `telescope` plugin itself (`plugins.telescope.enable = true`).
35
- '' ;
36
- }
37
- ] ;
29
+ assertions = lib . nixvim . mkAssertions "plugins.refactoring" {
30
+ assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
31
+
32
+ message = ''
33
+ You have enabled the `telescope` integration with refactoring-nvim.
34
+ However, you have not enabled the `telescope` plugin itself (`plugins.telescope.enable = true`).
35
+ '' ;
36
+ } ;
38
37
39
38
plugins . telescope . enabledExtensions = mkIf cfg . enableTelescope [ "refactoring" ] ;
40
39
} ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
27
27
assertions = lib . nixvim . mkAssertions "plugins.telekasten" {
28
28
assertion = config . plugins . telescope . enable ;
29
29
message = ''
30
- Nixvim (plugins.telekasten): The plugin needs telescope to function as intended .
30
+ You have to enable `plugins. telescope` as `enableTelescope` is activated .
31
31
'' ;
32
32
} ;
33
33
Original file line number Diff line number Diff line change @@ -90,20 +90,18 @@ lib.nixvim.plugins.mkNeovimPlugin {
90
90
} ;
91
91
92
92
extraConfig = {
93
- assertions = [
94
- {
95
- assertion =
96
- config . plugins . web-devicons . enable
97
- || (
98
- config . plugins . mini . enable
99
- && config . plugins . mini . modules ? icons
100
- && config . plugins . mini . mockDevIcons
101
- ) ;
102
- message = ''
103
- Nixvim: Either `plugins.web-devicons` or `plugins.mini`* must be enabled to use `tiny-devicons-auto-colors`.
104
- *If using `plugins.mini`, you must enable the `icons` module and the `mockDevIcons` option.
105
- '' ;
106
- }
107
- ] ;
93
+ assertions = lib . nixvim . mkAssertions "plugins.tiny-devicons-auto-colors" {
94
+ assertion =
95
+ config . plugins . web-devicons . enable
96
+ || (
97
+ config . plugins . mini . enable
98
+ && config . plugins . mini . modules ? icons
99
+ && config . plugins . mini . mockDevIcons
100
+ ) ;
101
+ message = ''
102
+ Either `plugins.web-devicons` or `plugins.mini`* must be enabled to use `tiny-devicons-auto-colors`.
103
+ *If using `plugins.mini`, you must enable the `icons` module and the `mockDevIcons` option.
104
+ '' ;
105
+ } ;
108
106
} ;
109
107
}
Original file line number Diff line number Diff line change @@ -414,18 +414,18 @@ lib.nixvim.plugins.mkNeovimPlugin {
414
414
} ;
415
415
416
416
extraConfig = cfg : {
417
- assertions = [
417
+ assertions = lib . nixvim . mkAssertions "plugins.todo-comments" [
418
418
{
419
419
assertion = cfg . keymaps . todoTelescope . key or null != null -> config . plugins . telescope . enable ;
420
420
message = ''
421
- Nixvim(plugins.todo-comments): You have enabled todo-comment's `telescope` integration.
421
+ You have enabled todo-comment's `telescope` integration.
422
422
However, you have not enabled the `telescope` plugin itself (`plugins.telescope.enable = true`).
423
423
'' ;
424
424
}
425
425
{
426
426
assertion = cfg . keymaps . todoTrouble . key or null != null -> config . plugins . trouble . enable ;
427
427
message = ''
428
- Nixvim(plugins.todo-comments): You have enabled todo-comment's `trouble` integration.
428
+ You have enabled todo-comment's `trouble` integration.
429
429
However, you have not enabled the `trouble` plugin itself (`plugins.trouble.enable = true`).
430
430
'' ;
431
431
}
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
363
363
{
364
364
assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
365
365
message = ''
366
- The telescope integration needs telescope to function as intended
366
+ You have to enable `plugins. telescope` as `enableTelescope` is activated.
367
367
'' ;
368
368
}
369
369
{
You can’t perform that action at this time.
0 commit comments