|
| 1 | +{ lib, pkgs, ... }: |
1 | 2 | { |
2 | 3 | empty = { |
3 | 4 | plugins.bufferline.enable = true; |
|
124 | 125 | }; |
125 | 126 | }; |
126 | 127 |
|
127 | | - no-packages = { |
| 128 | + default-packages = cfg: { |
| 129 | + plugins.bufferline = { |
| 130 | + enable = true; |
| 131 | + }; |
| 132 | + |
| 133 | + assertions = [ |
| 134 | + { |
| 135 | + assertion = |
| 136 | + cfg.config.extraPlugins != [ ] |
| 137 | + -> lib.any ( |
| 138 | + x: |
| 139 | + lib.trace "${x.pname or x.name}" x.pname or x.name != null && x.pname or x.name == "bufferline.nvim" |
| 140 | + ) cfg.config.extraPlugins; |
| 141 | + message = "nvim-web-devicons package wasn't found when it was expected"; |
| 142 | + } |
| 143 | + { |
| 144 | + assertion = |
| 145 | + cfg.config.extraPlugins != [ ] |
| 146 | + -> lib.any ( |
| 147 | + x: |
| 148 | + lib.trace "${x.pname or x.name}" x.pname or x.name != null |
| 149 | + && x.pname or x.name == "nvim-web-devicons" |
| 150 | + ) cfg.config.extraPlugins; |
| 151 | + message = "nvim-web-devicons package wasn't found when it was expected"; |
| 152 | + } |
| 153 | + ]; |
| 154 | + }; |
| 155 | + |
| 156 | + no-packages = cfg: { |
128 | 157 | plugins.bufferline = { |
129 | 158 | enable = true; |
130 | 159 | iconsPackage = null; |
131 | 160 | }; |
| 161 | + |
| 162 | + assertions = [ |
| 163 | + { |
| 164 | + assertion = |
| 165 | + cfg.config.extraPlugins != [ ] |
| 166 | + -> lib.any ( |
| 167 | + x: |
| 168 | + lib.trace "${x.pname or x.name}" x.pname or x.name != null |
| 169 | + && x.pname or x.name != "nvim-web-devicons" |
| 170 | + ) cfg.config.extraPlugins; |
| 171 | + message = "nvim-web-devicons package was found when it wasn't expected"; |
| 172 | + } |
| 173 | + ]; |
| 174 | + }; |
| 175 | + |
| 176 | + package-overrides = cfg: { |
| 177 | + plugins.bufferline = { |
| 178 | + enable = true; |
| 179 | + iconsPackage = pkgs.vimPlugins.mini-nvim; |
| 180 | + }; |
| 181 | + |
| 182 | + assertions = [ |
| 183 | + { |
| 184 | + assertion = |
| 185 | + cfg.config.extraPlugins != [ ] |
| 186 | + -> lib.any ( |
| 187 | + x: lib.trace "${x.pname or x.name}" x.pname or x.name != null && x.pname or x.name == "mini.nvim" |
| 188 | + ) cfg.config.extraPlugins; |
| 189 | + message = "mini-nvim package wasn't found when it was expected"; |
| 190 | + } |
| 191 | + { |
| 192 | + assertion = |
| 193 | + cfg.config.extraPlugins != [ ] |
| 194 | + -> lib.any ( |
| 195 | + x: |
| 196 | + lib.trace "${x.pname or x.name}" x.pname or x.name != null |
| 197 | + && x.pname or x.name != "nvim-web-devicons" |
| 198 | + ) cfg.config.extraPlugins; |
| 199 | + message = "nvim-web-devicons package was found when it wasn't expected"; |
| 200 | + } |
| 201 | + ]; |
132 | 202 | }; |
133 | 203 | } |
0 commit comments