8
8
by-name = ../plugins/by-name ;
9
9
options = lib . collect lib . isOption nixvimConfiguration . options ;
10
10
11
- # Option namespaces that we allow by-name plugins to declare
12
- knownPluginNamespaces = [
13
- "colorschemes"
14
- "plugins"
15
- ] ;
11
+ # Option namespace expect by-name plugins to use
12
+ namespace = "plugins" ;
16
13
17
14
# Group by-name children by filetype; "regular", "directory", "symlink" and "unknown".
18
15
children =
@@ -157,17 +154,10 @@ linkFarmFromDrvs "plugins-by-name" [
157
154
{
158
155
__structuredAttrs = true ;
159
156
160
- # I'm sorry, I couldn't help implementing oxford-comma...
161
- expected =
162
- let
163
- len = builtins . length knownPluginNamespaces ;
164
- in
165
- lib . concatImapStringsSep ", " (
166
- i : str : lib . optionalString ( i > 1 && i == len ) "or " + "`${ str } `"
167
- ) knownPluginNamespaces ;
157
+ inherit namespace ;
168
158
169
159
options = lib . pipe by-name-enable-opts [
170
- ( lib . filterAttrs ( file : loc : ! ( builtins . elem ( builtins . head loc ) knownPluginNamespaces ) ) )
160
+ ( lib . filterAttrs ( file : loc : builtins . head loc != namespace ) )
171
161
( lib . mapAttrs ( file : loc : "`${ lib . showOption loc } `" ) )
172
162
] ;
173
163
@@ -178,7 +168,7 @@ linkFarmFromDrvs "plugins-by-name" [
178
168
''
179
169
if (( '' ${#options[@]} > 0 )); then
180
170
echo "Found plugin modules with unknown option namespaces ('' ${#options[@]})"
181
- echo "Expected all plugins to be scoped as $expected "
171
+ echo "Expected all plugins to be scoped as $namespace "
182
172
for file in "'' ${!options[@]}"; do
183
173
echo "- '' ${options[$file]} is declared in '$file'"
184
174
done
0 commit comments