File tree Expand file tree Collapse file tree 3 files changed +35
-62
lines changed Expand file tree Collapse file tree 3 files changed +35
-62
lines changed Original file line number Diff line number Diff line change 4
4
pkgs ,
5
5
} :
6
6
let
7
- pkgsDoc =
8
- import
9
- ( pkgs . applyPatches {
10
- name = "nixpkgs-nixvim-doc" ;
11
- src = pkgs . path ;
12
- patches = [ ./either_recursive.patch ] ;
13
- } )
14
- {
15
- inherit ( pkgs ) system ;
16
- config . allowUnfree = true ;
7
+ # Extend nixpkg's lib, so that we can handle recursive leaf types such as `either`
8
+ lib = pkgs . lib . extend (
9
+ final : prev : {
10
+ types = prev . types // {
11
+ either =
12
+ t1 : t2 :
13
+ ( prev . types . either t1 t2 )
14
+ // {
15
+ getSubOptions = prefix : ( t1 . getSubOptions prefix ) // ( t2 . getSubOptions prefix ) ;
16
+ } ;
17
+
18
+ eitherRecursive = t1 : t2 : ( final . types . either t1 t2 ) // { getSubOptions = _ : { } ; } ;
19
+
20
+ oneOfRecursive =
21
+ ts :
22
+ let
23
+ head' =
24
+ if ts == [ ] then
25
+ throw "types.oneOfRecursive needs to get at least one type in its argument"
26
+ else
27
+ builtins . head ts ;
28
+ tail' = builtins . tail ts ;
29
+ in
30
+ builtins . foldl' final . types . eitherRecursive head' tail' ;
17
31
} ;
32
+ }
33
+ ) ;
18
34
19
- inherit ( pkgsDoc ) lib ;
35
+ pkgsDoc = pkgs // {
36
+ inherit lib ;
37
+ } ;
20
38
21
39
nixvimPath = toString ./.. ;
22
40
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
{
2
2
perSystem =
3
3
{
4
- pkgs ,
4
+ pkgsUnfree ,
5
5
config ,
6
6
rawModules ,
7
7
helpers ,
8
8
...
9
9
} :
10
10
{
11
- packages = import ../docs { inherit rawModules pkgs helpers ; } ;
11
+ packages = import ../docs {
12
+ inherit rawModules helpers ;
13
+ # Building the docs evaluates each plugin's default package, some of which are unfree
14
+ pkgs = pkgsUnfree ;
15
+ } ;
12
16
13
17
# Test that all packages build fine when running `nix flake check`.
14
18
checks = config . packages ;
You can’t perform that action at this time.
0 commit comments