File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 5
5
runCommandLocal ,
6
6
} :
7
7
let
8
+ nixvim-root = ../. ;
8
9
by-name = ../plugins/by-name ;
9
10
options = lib . collect lib . isOption nixvimConfiguration . options ;
10
11
12
+ toRelative = lib . removePrefix ( toString nixvim-root ) ;
13
+
11
14
# Option namespace expect by-name plugins to use
12
15
namespace = "plugins" ;
13
16
30
33
# Find plugins by looking for `*.*.enable` options that are declared in `plugins/by-name`
31
34
by-name-enable-opts =
32
35
let
33
- regex = ''/nix/store/[^/]+/plugins/by-name/(.*)'' ;
34
36
optionalPair =
35
37
opt : file :
36
38
let
37
- result = builtins . match regex file ;
38
- in
39
- lib . optional ( result != null ) {
39
+ relative = toRelative file ;
40
40
# Use the file name relative to `plugins/by-name/`
41
- name = builtins . head result ;
41
+ name = lib . removePrefix "plugins/by-name/" relative ;
42
+ hasPrefix = name != relative ;
43
+ in
44
+ lib . optional hasPrefix {
45
+ inherit name ;
42
46
# Use only the first two parts of the option location
43
47
value = lib . genList ( builtins . elemAt opt . loc ) 2 ;
44
48
} ;
You can’t perform that action at this time.
0 commit comments