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 {
176176 } ;
177177
178178 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+ } ;
188186 } ;
189187
190188 # 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 {
5959 extraConfig =
6060 cfg :
6161 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+ } ;
6868
6969 extraPackages = [ cfg . gitPackage ] ;
7070
Original file line number Diff line number Diff line change 191191 // cfg . extraOptions ;
192192 in
193193 mkIf cfg . enable {
194- assertions = [
194+ assertions = lib . nixvim . mkAssertions "plugins.harpoon" [
195195 {
196196 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." ;
198198 }
199199 ] ;
200200
Original file line number Diff line number Diff line change 231231 config = mkIf cfg . enable {
232232 extraPlugins = [ cfg . package ] ;
233233
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+ } ;
257255
258256 extraPackages = [ cfg . leanPackage ] ;
259257
Original file line number Diff line number Diff line change @@ -94,15 +94,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
9494 callSetup = false ;
9595 hasSettings = false ;
9696 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+
106105 plugins . mini . luaConfig . content =
107106 lib . foldlAttrs ( lines : name : config : ''
108107 ${ lines }
Original file line number Diff line number Diff line change 3737 mkIf cfg . enable {
3838 extraPlugins = [ cfg . package ] ;
3939
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+ } ;
4646
4747 warnings = lib . nixvim . mkWarnings "plugins.neotest.adapters.${ name } " {
4848 when = ! config . plugins . treesitter . enable ;
Original file line number Diff line number Diff line change @@ -137,17 +137,16 @@ lib.nixvim.plugins.mkNeovimPlugin {
137137 '' ;
138138 } ;
139139
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+ } ;
151150
152151 # We only do this here because of enableLspFormat
153152 plugins . none-ls . luaConfig . content = ''
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
111111 assertions = lib . nixvim . mkAssertions "plugins.package-info" {
112112 assertion = cfg . enableTelescope -> config . plugins . telescope . enable ;
113113 message = ''
114- The telescope integration needs telescope to function as intended .
114+ You have to enable `plugins. telescope` as `enableTelescope` is activated .
115115 '' ;
116116 } ;
117117
Original file line number Diff line number Diff line change @@ -119,16 +119,15 @@ with lib;
119119 when = ! config . plugins . treesitter . enable ;
120120 message = "This plugin needs treesitter to function as intended." ;
121121 } ;
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+ } ;
132131
133132 extraPlugins = [ cfg . package ] ;
134133
Original file line number Diff line number Diff line change @@ -26,15 +26,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
2626 } ;
2727
2828 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+ } ;
3837
3938 plugins . telescope . enabledExtensions = mkIf cfg . enableTelescope [ "refactoring" ] ;
4039 } ;
You can’t perform that action at this time.
0 commit comments