|
86 | 86 | }
|
87 | 87 | )
|
88 | 88 | ) tools;
|
| 89 | + |
| 90 | + # Added 2025-06-25 in https://github.com/nix-community/nixvim/pull/3503 |
| 91 | + imports = |
| 92 | + map (name: lib.mkRenamedOptionModule [ name ] [ (lib.toLower name) ]) [ |
| 93 | + "HTML" |
| 94 | + "JSON" |
| 95 | + ] |
| 96 | + ++ lib.singleton { |
| 97 | + # NOTE: we need a warnings option for `mkRenamedOptionModule` to warn about unexpected definitions |
| 98 | + # This can be removed when all rename aliases are gone |
| 99 | + options.warnings = lib.mkOption { |
| 100 | + type = with lib.types; listOf str; |
| 101 | + description = "Warnings to propagate to nixvim's `warnings` option."; |
| 102 | + default = [ ]; |
| 103 | + internal = true; |
| 104 | + visible = false; |
| 105 | + }; |
| 106 | + }; |
89 | 107 | };
|
90 | 108 | description = "Configuration for each filetype. Use `all` to match any filetype.";
|
91 | 109 | default = { };
|
|
98 | 116 | # Tools that have been selected by the user
|
99 | 117 | tools = lib.lists.unique (
|
100 | 118 | lib.filter lib.isString (
|
101 |
| - lib.concatMap ( |
102 |
| - { |
103 |
| - linter ? [ ], |
104 |
| - formatter ? [ ], |
105 |
| - }: |
106 |
| - (lib.toList linter) ++ (lib.toList formatter) |
107 |
| - ) (lib.attrValues cfg.setup) |
| 119 | + lib.concatMap |
| 120 | + ( |
| 121 | + { |
| 122 | + linter ? [ ], |
| 123 | + formatter ? [ ], |
| 124 | + }: |
| 125 | + (lib.toList linter) ++ (lib.toList formatter) |
| 126 | + ) |
| 127 | + ( |
| 128 | + lib.attrValues ( |
| 129 | + # Rename aliases added 2025-06-25 in https://github.com/nix-community/nixvim/pull/3503 |
| 130 | + builtins.removeAttrs cfg.setup [ |
| 131 | + "warnings" |
| 132 | + "HTML" |
| 133 | + "JSON" |
| 134 | + ] |
| 135 | + ) |
| 136 | + ) |
108 | 137 | )
|
109 | 138 | );
|
110 | 139 |
|
|
131 | 160 | ) (lib.toList opt);
|
132 | 161 |
|
133 | 162 | setupOptions =
|
134 |
| - (lib.mapAttrs ( |
135 |
| - _: |
136 |
| - { |
137 |
| - linter ? [ ], |
138 |
| - formatter ? [ ], |
139 |
| - }: |
140 |
| - (mkToolValue "linters" linter) ++ (mkToolValue "formatters" formatter) |
141 |
| - ) (lib.attrsets.filterAttrs (v: _: v != "all") cfg.setup)) |
| 163 | + (lib.mapAttrs |
| 164 | + ( |
| 165 | + _: |
| 166 | + { |
| 167 | + linter ? [ ], |
| 168 | + formatter ? [ ], |
| 169 | + }: |
| 170 | + (mkToolValue "linters" linter) ++ (mkToolValue "formatters" formatter) |
| 171 | + ) |
| 172 | + ( |
| 173 | + builtins.removeAttrs cfg.setup [ |
| 174 | + "all" |
| 175 | + "warnings" |
| 176 | + ] |
| 177 | + ) |
| 178 | + ) |
142 | 179 | // {
|
143 | 180 | "=" =
|
144 | 181 | (mkToolValue "linters" cfg.setup.all.linter) ++ (mkToolValue "formatters" cfg.setup.all.formatter);
|
|
164 | 201 |
|
165 | 202 | extraPackages = [ cfg.efmLangServerPackage ] ++ (map (v: cfg.toolPackages.${v}) nixvimPkgs.right);
|
166 | 203 | };
|
| 204 | + |
| 205 | + imports = lib.singleton { |
| 206 | + # Propagate setup warnings |
| 207 | + inherit (config.plugins.efmls-configs.setup) warnings; |
| 208 | + }; |
167 | 209 | }
|
0 commit comments