Skip to content

Commit c369dba

Browse files
committed
pkgs/doc: rewrite links
1 parent e832ffc commit c369dba

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pkgs/doc.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ let
1616
})
1717
];
1818
})) options;
19+
20+
transformOptions = opt: opt // {
21+
declarations = map (decl:
22+
let
23+
root = toString ../.;
24+
declStr = toString decl;
25+
declPath = lib.removePrefix (toString ../.) decl;
26+
in
27+
if lib.hasPrefix root declStr
28+
# Rewrite links from ../. in the /nix/store to the source on Github
29+
then {
30+
name = "microvm.nix${declPath}";
31+
url = "https://github.com/astro/microvm.nix/tree/main${declPath}";
32+
}
33+
else decl
34+
) opt.declarations;
35+
};
1936
};
2037

2138
microvmDoc = makeOptionsDoc ../nixos-modules/microvm/options.nix;

0 commit comments

Comments
 (0)