File tree 3 files changed +47
-20
lines changed
3 files changed +47
-20
lines changed Original file line number Diff line number Diff line change 5
5
{
6
6
name ,
7
7
maintainers ,
8
- url ? throw "default" ,
8
+ url ? null ,
9
9
imports ? [ ] ,
10
10
description ? null ,
11
11
# deprecations
62
62
luaConfigAtLocation = utils . mkConfigAt configLocation cfg . luaConfig . content ;
63
63
in
64
64
{
65
- meta = {
66
- inherit maintainers ;
67
- nixvimInfo = {
68
- inherit description ;
69
- url = args . url or opts . package . default . meta . homepage ;
70
- path = loc ;
71
- } ;
72
- } ;
73
-
74
65
options = lib . setAttrByPath loc (
75
66
{
76
67
enable = lib . mkEnableOption packPathName ;
168
159
++ [
169
160
module
170
161
( utils . mkPluginPackageModule { inherit loc packPathName package ; } )
162
+ ( utils . mkMetaModule {
163
+ inherit
164
+ loc
165
+ maintainers
166
+ description
167
+ url
168
+ ;
169
+ } )
171
170
]
172
171
++ lib . optional deprecateExtraOptions (
173
172
lib . mkRenamedOptionModule ( loc ++ [ "extraOptions" ] ) settingsPath
Original file line number Diff line number Diff line change 4
4
} :
5
5
{
6
6
name ,
7
- url ? throw "default" ,
7
+ url ? null ,
8
8
maintainers ,
9
9
imports ? [ ] ,
10
10
description ? null ,
55
55
opts = lib . getAttrFromPath loc options ;
56
56
in
57
57
{
58
- meta = {
59
- inherit maintainers ;
60
- nixvimInfo = {
61
- inherit description ;
62
- url = args . url or opts . package . default . meta . homepage ;
63
- path = loc ;
64
- } ;
65
- } ;
66
-
67
58
options = lib . setAttrByPath loc (
68
59
{
69
60
enable = lib . mkEnableOption packPathName ;
100
91
++ [
101
92
module
102
93
( lib . nixvim . plugins . utils . mkPluginPackageModule { inherit loc packPathName package ; } )
94
+ ( lib . nixvim . plugins . utils . mkMetaModule {
95
+ inherit
96
+ loc
97
+ maintainers
98
+ description
99
+ url
100
+ ;
101
+ } )
103
102
]
104
103
++ lib . optional ( deprecateExtraConfig && createSettingsOption ) (
105
104
lib . mkRenamedOptionModule ( loc ++ [ "extraConfig" ] ) settingsPath
Original file line number Diff line number Diff line change 82
82
] ;
83
83
} ;
84
84
} ;
85
+
86
+ /**
87
+ Produce a module that defines a plugin's metadata.
88
+ */
89
+ mkMetaModule =
90
+ {
91
+ loc ,
92
+ maintainers ,
93
+ description ,
94
+ url ? null ,
95
+ } @args :
96
+ { options , ... } :
97
+ let
98
+ opts = lib . getAttrFromPath loc options ;
99
+ url =
100
+ if args . url or null == null then
101
+ opts . package . default . meta . homepage or ( throw "unable to get URL for `${ lib . showOption loc } `." )
102
+ else
103
+ args . url ;
104
+ in
105
+ {
106
+ meta = {
107
+ inherit maintainers ;
108
+ nixvimInfo = {
109
+ inherit description url ;
110
+ path = loc ;
111
+ } ;
112
+ } ;
113
+ } ;
85
114
}
You can’t perform that action at this time.
0 commit comments