|
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 | + }; |
| 21 | + |
| 22 | + # Filter out any broken or missing packages from our tests. |
| 23 | + filterBrokenPackages = n: package: package != null && !(package.meta.broken or false); |
13 | 24 | in |
14 | 25 | { |
15 | 26 | inherit tools run; |
16 | 27 | # Flake style attributes |
17 | | - packages = (lib.filterAttrs (_name: value: value != null) tools) // { |
| 28 | + packages = (lib.filterAttrs filterBrokenPackages tools) // { |
18 | 29 | inherit (pkgs) pre-commit; |
19 | 30 | }; |
20 | 31 | checks = self.packages // { |
|
39 | 50 | specialArgs = { inherit pkgs; }; |
40 | 51 | }; |
41 | 52 | allHooks = config.config.hooks; |
| 53 | + |
| 54 | + getEntry = n: v: v.entry; |
| 55 | + getPackage = |
| 56 | + f: n: h: |
| 57 | + f n h.package; |
| 58 | + |
42 | 59 | allEntryPoints = lib.pipe allHooks [ |
43 | | - (lib.filterAttrs (_name: value: value.package != null)) |
44 | | - (lib.mapAttrsToList (_: value: value.entry)) |
| 60 | + (lib.filterAttrs (getPackage filterBrokenPackages)) |
| 61 | + (lib.mapAttrsToList getEntry) |
45 | 62 | ]; |
46 | 63 | in |
47 | 64 | pkgs.runCommand "all-tools-eval" |
48 | 65 | { |
49 | 66 | inherit allEntryPoints; |
50 | | - } '' |
51 | | - touch $out |
52 | | - ''; |
| 67 | + } |
| 68 | + '' |
| 69 | + touch $out |
| 70 | + ''; |
53 | 71 | doc-check = |
54 | 72 | let |
55 | 73 | # We might add that it keeps rendering fast and robust, |
56 | 74 | # and we want to teach `defaultText` which is more broadly applicable, |
57 | 75 | # but the message is long enough. |
58 | | - failPkgAttr = name: _v: |
| 76 | + failPkgAttr = |
| 77 | + name: _v: |
59 | 78 | throw '' |
60 | 79 | While generating documentation, we found that `pkgs` was used. To avoid rendering store paths in the documentation, this is forbidden. |
61 | 80 |
|
|
78 | 97 | _type = "pkgs"; |
79 | 98 | inherit lib; |
80 | 99 | 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`." |
| 100 | + ( |
| 101 | + formatName: formatFn: formatArgs: |
| 102 | + let |
| 103 | + result = formatFn formatArgs; |
| 104 | + stubs = lib.mapAttrs |
| 105 | + ( |
| 106 | + name: _: |
| 107 | + 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 | 108 | ) |
90 | 109 | result; |
91 | | - in |
92 | | - stubs // { |
93 | | - inherit (result) type; |
94 | | - } |
| 110 | + in |
| 111 | + stubs |
| 112 | + // { |
| 113 | + inherit (result) type; |
| 114 | + } |
95 | 115 | ) |
96 | 116 | pkgs.formats; |
97 | 117 | }; |
|
110 | 130 | import nixpkgs { |
111 | 131 | overlays = [ overlay ]; |
112 | 132 | # broken is needed for hindent to build |
113 | | - config = { allowBroken = true; }; |
| 133 | + config = { |
| 134 | + allowBroken = true; |
| 135 | + }; |
114 | 136 | inherit system; |
115 | 137 | } |
0 commit comments