File tree Expand file tree Collapse file tree 13 files changed +63
-72
lines changed Expand file tree Collapse file tree 13 files changed +63
-72
lines changed Original file line number Diff line number Diff line change 177
177
178
178
extraPlugins = [ cfg . package ] ;
179
179
180
- assertions = [
180
+ assertions = lib . nixvim . mkAssertions "plugins.alpha" [
181
181
{
182
182
assertion = themeDefined || layoutDefined ;
183
183
message = ''
184
- Nixvim (plugins.alpha): You have to either set a `theme` or define some sections in `layout`.
184
+ You have to either set a `theme` or define some sections in `layout`.
185
185
'' ;
186
186
}
187
187
{
188
188
assertion = ! ( themeDefined && layoutDefined ) ;
189
189
message = ''
190
- Nixvim (plugins.alpha): You can't define both a `theme` and custom options.
190
+ You can't define both a `theme` and custom options.
191
191
Set `plugins.alpha.theme = null` if you want to configure alpha manually using the `layout` option.
192
192
'' ;
193
193
}
Original file line number Diff line number Diff line change @@ -86,14 +86,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
86
86
87
87
callSetup = false ;
88
88
extraConfig = cfg : {
89
- assertions = [
90
- {
91
- assertion = config . plugins . lsp . enable ;
92
- message = ''
93
- Nixvim (plugins.lsp-status): `plugins.lsp` must be enabled to use lsp-status
94
- '' ;
95
- }
96
- ] ;
89
+ assertions = lib . nixvim . mkAssertions "plugins.lsp-status" {
90
+ assertion = config . plugins . lsp . enable ;
91
+ message = ''
92
+ `plugins.lsp` must be enabled to use lsp-status
93
+ '' ;
94
+ } ;
97
95
98
96
plugins . lsp = {
99
97
preConfig = ''
Original file line number Diff line number Diff line change 152
152
config = mkIf cfg . enable {
153
153
extraPlugins = [ cfg . package ] ;
154
154
155
- assertions = [
156
- {
157
- assertion = all ( n : elem n ( range 0 9 ) ) ( attrNames cfg . bookmarks ) ;
158
- message = ''
159
- Nixvim (plugins.marks): The keys of the `bookmarks` option should be integers between 0 and 9.
160
- '' ;
161
- }
162
- ] ;
155
+ assertions = lib . nixvim . mkAssertions "plugins.mark" {
156
+ assertion = all ( n : elem n ( range 0 9 ) ) ( attrNames cfg . bookmarks ) ;
157
+ message = ''
158
+ The keys of the `bookmarks` option should be integers between 0 and 9.
159
+ '' ;
160
+ } ;
163
161
164
162
extraConfigLua =
165
163
let
Original file line number Diff line number Diff line change @@ -249,16 +249,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
249
249
'' ;
250
250
} ;
251
251
252
- assertions = [
253
- {
254
- assertion =
255
- isBool cfg . settings . enable_persistent_history && cfg . settings . enable_persistent_history
256
- -> config . plugins . sqlite-lua . enable ;
257
- message = ''
258
- Nixvim (plugins.neoclip): The persistent history sqlite storage backend needs `sqlite-lua` to function as intended.
259
- You can enable it by setting `plugins.sqlite-lua.enable` to `true`.
260
- '' ;
261
- }
262
- ] ;
252
+ assertions = lib . nixvim . mkAssertions "plugins.neoclip" {
253
+ assertion =
254
+ isBool cfg . settings . enable_persistent_history && cfg . settings . enable_persistent_history
255
+ -> config . plugins . sqlite-lua . enable ;
256
+ message = ''
257
+ The persistent history sqlite storage backend needs `sqlite-lua` to function as intended.
258
+ You can enable it by setting `plugins.sqlite-lua.enable` to `true`.
259
+ '' ;
260
+ } ;
263
261
} ;
264
262
}
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
111
111
} ;
112
112
113
113
extraConfig = cfg : {
114
- assertions =
114
+ assertions = lib . nixvim . mkAssertions "plugins.neogit" (
115
115
map
116
116
( name : {
117
117
assertion =
@@ -121,14 +121,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
121
121
in
122
122
isEnabled -> config . plugins . ${ name } . enable ;
123
123
message = ''
124
- Nixvim (plugins.neogit): You have enabled the `${ name } ` integration, but `plugins.${ name } .enable` is `false`.
124
+ You have enabled the `${ name } ` integration, but `plugins.${ name } .enable` is `false`.
125
125
'' ;
126
126
} )
127
127
[
128
128
"telescope"
129
129
"diffview"
130
130
"fzf-lua"
131
- ] ;
131
+ ]
132
+ ) ;
132
133
133
134
extraPackages =
134
135
[
Original file line number Diff line number Diff line change 119
119
} // cfg . extraOptions ;
120
120
in
121
121
mkIf cfg . enable {
122
- assertions = [
122
+ assertions = lib . nixvim . mkAssertions "plugins.nvim-jdtls" [
123
123
{
124
124
assertion = cfg . cmd != null || cfg . data != null ;
125
125
message = "You have to either set the `plugins.nvim-jdtls.data` or the `plugins.nvim-jdtls.cmd` option." ;
126
126
}
127
127
{
128
128
assertion = cfg . cmd == null -> cfg . jdtLanguageServerPackage != null ;
129
129
message = ''
130
- Nixvim (plugins.nvim-jdtls) You haven't defined a `cmd` or `jdtLanguageServerPackage`.
130
+ You haven't defined a `cmd` or `jdtLanguageServerPackage`.
131
131
132
132
The default `cmd` requires `plugins.nvim-jdtls.jdtLanguageServerPackage` to be set.
133
133
'' ;
Original file line number Diff line number Diff line change @@ -108,14 +108,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
108
108
} ;
109
109
110
110
extraConfig = cfg : {
111
- assertions = [
112
- {
113
- assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
114
- message = ''
115
- Nixvim (plugins.package-info): The telescope integration needs telescope to function as intended.
116
- '' ;
117
- }
118
- ] ;
111
+ assertions = lib . nixvim . mkAssertions "plugins.package-info" {
112
+ assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
113
+ message = ''
114
+ The telescope integration needs telescope to function as intended.
115
+ '' ;
116
+ } ;
119
117
120
118
extraPackages = [ cfg . packageManagerPackage ] ;
121
119
Original file line number Diff line number Diff line change @@ -226,17 +226,17 @@ lib.nixvim.plugins.mkNeovimPlugin {
226
226
callSetup = false ;
227
227
228
228
extraConfig = cfg : {
229
- assertions = [
229
+ assertions = lib . nixvim . mkAssertions "plugins.rest" [
230
230
{
231
231
assertion = config . plugins . treesitter . enable ;
232
232
message = ''
233
- Nixvim (plugins.rest): Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`.
233
+ Requires the `http` parser from `plugins.treesitter`, please set `plugins.treesitter.enable`.
234
234
'' ;
235
235
}
236
236
{
237
237
assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
238
238
message = ''
239
- Nixvim (plugins.rest): You have `plugins.rest.enableTelescope` set to true, but `plugins.telescope.enable` is false.
239
+ You have `plugins.rest.enableTelescope` set to true, but `plugins.telescope.enable` is false.
240
240
Either disable the telescope integration or enable telescope.
241
241
'' ;
242
242
}
Original file line number Diff line number Diff line change @@ -57,15 +57,13 @@ lib.nixvim.plugins.mkNeovimPlugin {
57
57
58
58
globals . rustaceanvim = cfg . settings ;
59
59
60
- assertions = [
61
- {
62
- assertion = cfg . enable -> ! config . plugins . lsp . servers . rust_analyzer . enable ;
63
- message = ''
64
- Nixvim (plugins.rustaceanvim): Both `plugins.rustaceanvim.enable` and `plugins.lsp.servers.rust_analyzer.enable` are true.
65
- Disable one of them otherwise you will have multiple clients attached to each buffer.
66
- '' ;
67
- }
68
- ] ;
60
+ assertions = lib . nixvim . mkAssertions "plugins.rustaceanvim" {
61
+ assertion = cfg . enable -> ! config . plugins . lsp . servers . rust_analyzer . enable ;
62
+ message = ''
63
+ Both `plugins.rustaceanvim.enable` and `plugins.lsp.servers.rust_analyzer.enable` are true.
64
+ Disable one of them otherwise you will have multiple clients attached to each buffer.
65
+ '' ;
66
+ } ;
69
67
70
68
# TODO: remove after 24.11
71
69
warnings = lib . nixvim . mkWarnings "plugins.rustaceanvim" {
Original file line number Diff line number Diff line change 267
267
sectionNames = attrNames cfg . sections ;
268
268
numSections = length sectionNames ;
269
269
in
270
- [
270
+ lib . nixvim . mkAssertions "plugins.startup" [
271
271
{
272
272
assertion = ( cfg . options . paddings == null ) || ( length cfg . options . paddings ) == numSections ;
273
273
message = ''
274
- Nixvim (plugins.startup): Make sure that `plugins.startup.options.paddings` has the same
274
+ Make sure that `plugins.startup.options.paddings` has the same
275
275
number of elements as there are sections.
276
276
'' ;
277
277
}
278
278
{
279
279
assertion =
280
280
( ( length cfg . parts ) <= numSections ) && ( all ( part : hasAttr part cfg . sections ) cfg . parts ) ;
281
281
message = ''
282
- Nixvim (plugins.startup): You should not have more section names in `plugins.startup.parts` than you have sections defined.
282
+ You should not have more section names in `plugins.startup.parts` than you have sections defined.
283
283
'' ;
284
284
}
285
285
] ;
You can’t perform that action at this time.
0 commit comments