|
2 | 2 | , nixpkgs |
3 | 3 | , gitignore-nix-src |
4 | 4 | , isFlakes ? false |
| 5 | +, |
5 | 6 | }: |
6 | 7 | let |
7 | 8 | overlay = |
8 | 9 | self: pkgs: |
9 | 10 | let |
10 | 11 | inherit (pkgs) lib; |
11 | 12 | tools = import ./call-tools.nix pkgs; |
12 | | - run = pkgs.callPackage ./run.nix { inherit pkgs tools isFlakes gitignore-nix-src; }; |
| 13 | + run = pkgs.callPackage ./run.nix { |
| 14 | + inherit |
| 15 | + pkgs |
| 16 | + tools |
| 17 | + isFlakes |
| 18 | + gitignore-nix-src |
| 19 | + ; |
| 20 | + }; |
13 | 21 | in |
14 | 22 | { |
15 | 23 | inherit tools run; |
|
39 | 47 | specialArgs = { inherit pkgs; }; |
40 | 48 | }; |
41 | 49 | allHooks = config.config.hooks; |
| 50 | + |
| 51 | + # Don't test broken or missing packages |
| 52 | + filterBrokenPackages = |
| 53 | + n: h: |
| 54 | + let |
| 55 | + inherit (h) package; |
| 56 | + in |
| 57 | + package != null && (package.meta.broken or false) != true; |
| 58 | + getEntry = n: v: v.entry; |
| 59 | + |
42 | 60 | allEntryPoints = lib.pipe allHooks [ |
43 | | - (lib.filterAttrs (_name: value: value.package != null)) |
44 | | - (lib.mapAttrsToList (_: value: value.entry)) |
| 61 | + (lib.filterAttrs filterBrokenPackages) |
| 62 | + (lib.mapAttrsToList getEntry) |
45 | 63 | ]; |
46 | 64 | in |
47 | 65 | pkgs.runCommand "all-tools-eval" |
48 | 66 | { |
49 | 67 | inherit allEntryPoints; |
50 | | - } '' |
51 | | - touch $out |
52 | | - ''; |
| 68 | + } |
| 69 | + '' |
| 70 | + touch $out |
| 71 | + ''; |
53 | 72 | doc-check = |
54 | 73 | let |
55 | 74 | # We might add that it keeps rendering fast and robust, |
56 | 75 | # and we want to teach `defaultText` which is more broadly applicable, |
57 | 76 | # but the message is long enough. |
58 | | - failPkgAttr = name: _v: |
| 77 | + failPkgAttr = |
| 78 | + name: _v: |
59 | 79 | throw '' |
60 | 80 | While generating documentation, we found that `pkgs` was used. To avoid rendering store paths in the documentation, this is forbidden. |
61 | 81 |
|
|
78 | 98 | _type = "pkgs"; |
79 | 99 | inherit lib; |
80 | 100 | formats = lib.mapAttrs |
81 | | - (formatName: formatFn: |
82 | | - formatArgs: |
83 | | - let |
84 | | - result = formatFn formatArgs; |
85 | | - stubs = |
86 | | - lib.mapAttrs |
87 | | - (name: _: |
88 | | - throw "The attribute `(pkgs.formats.${lib.strings.escapeNixIdentifier formatName} x).${lib.strings.escapeNixIdentifier name}` is not supported during documentation generation. Please check with `--show-trace` to see which option leads to this `${lib.strings.escapeNixIdentifier name}` reference. Often it can be cut short with a `defaultText` argument to `lib.mkOption`, or by escaping an option `example` using `lib.literalExpression`." |
| 101 | + ( |
| 102 | + formatName: formatFn: formatArgs: |
| 103 | + let |
| 104 | + result = formatFn formatArgs; |
| 105 | + stubs = lib.mapAttrs |
| 106 | + ( |
| 107 | + name: _: |
| 108 | + throw "The attribute `(pkgs.formats.${lib.strings.escapeNixIdentifier formatName} x).${lib.strings.escapeNixIdentifier name}` is not supported during documentation generation. Please check with `--show-trace` to see which option leads to this `${lib.strings.escapeNixIdentifier name}` reference. Often it can be cut short with a `defaultText` argument to `lib.mkOption`, or by escaping an option `example` using `lib.literalExpression`." |
89 | 109 | ) |
90 | 110 | result; |
91 | | - in |
92 | | - stubs // { |
93 | | - inherit (result) type; |
94 | | - } |
| 111 | + in |
| 112 | + stubs |
| 113 | + // { |
| 114 | + inherit (result) type; |
| 115 | + } |
95 | 116 | ) |
96 | 117 | pkgs.formats; |
97 | 118 | }; |
|
110 | 131 | import nixpkgs { |
111 | 132 | overlays = [ overlay ]; |
112 | 133 | # broken is needed for hindent to build |
113 | | - config = { allowBroken = true; }; |
| 134 | + config = { |
| 135 | + allowBroken = true; |
| 136 | + }; |
114 | 137 | inherit system; |
115 | 138 | } |
0 commit comments