Skip to content

Commit acda996

Browse files
authored
ci(tests-docs): remove warning (#268)
builtins.path in docgen to make sure it actually knows what repository it is in despite discarded context. Also stop it from writing the files of maintainers into the meta-maintainers-test derivation, for the same reason, the values you get for file during type merging have discarded context.
1 parent cfed455 commit acda996

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

checks/meta-maintainers.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ pkgs.runCommand "meta-maintainers-test" { } ''
2424
echo "Testing meta.maintainers field with nixpkgs maintainer..."
2525
2626
# Check that meta.maintainers is set correctly
27-
maintainers='${builtins.toJSON moduleConfig.meta.maintainers}'
27+
maintainers='${builtins.toJSON (map (v: removeAttrs v [ "file" ]) moduleConfig.meta.maintainers)}'
2828
echo "Maintainers: $maintainers"
2929
30+
if ${if builtins.all (v: v ? file) moduleConfig.meta.maintainers then "false" else "true"}; then
31+
echo "FAIL: a meta.maintainers entry is missing a file field"
32+
exit 1
33+
fi
34+
3035
# Verify the maintainer has all required fields
3136
if ! echo "$maintainers" | grep -q ${esc nixpkgsMaintainer.name}; then
3237
echo "FAIL: name ${esc nixpkgsMaintainer.name} not found in maintainers"

docs/default.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ in
7979
drv.core_docs = buildModuleDocs {
8080
package = pkgs.hello;
8181
title = "Core (builtin) Options set";
82-
} "core" wlib.core;
82+
} "core" { };
8383
books.nix-wrapper-modules = {
8484
book = {
8585
book = {
@@ -110,13 +110,13 @@ in
110110
name = "Getting Started";
111111
data = "numbered";
112112
path = "md/getting-started.md";
113-
src = ./md/getting-started.md;
113+
src = builtins.path { path = ./md/getting-started.md; };
114114
}
115115
{
116116
name = "Lib Functions";
117117
data = "numbered";
118118
path = "md/lib-intro.md";
119-
src = ./md/lib-intro.md;
119+
src = builtins.path { path = ./md/lib-intro.md; };
120120
subchapters = [
121121
{
122122
name = "wlib";
@@ -166,7 +166,7 @@ in
166166
name = "Helper Modules";
167167
data = "numbered";
168168
path = "md/helper-modules.md";
169-
src = ./md/helper-modules.md;
169+
src = builtins.path { path = ./md/helper-modules.md; };
170170
subchapters = lib.mapAttrsToList (n: _: {
171171
name = n;
172172
data = "numbered";
@@ -178,7 +178,7 @@ in
178178
name = "Wrapper Modules";
179179
data = "numbered";
180180
path = "md/wrapper-modules.md";
181-
src = ./md/wrapper-modules.md;
181+
src = builtins.path { path = ./md/wrapper-modules.md; };
182182
subchapters = lib.mapAttrsToList (n: _: {
183183
name = n;
184184
data = "numbered";

0 commit comments

Comments
 (0)