mirror of
https://github.com/foo-dogsquared/nix-module-wrapper-manager-fds.git
synced 2025-02-07 06:19:02 +00:00
wrapper-manager-fds/docs: update declarations for nixosOptionsDoc
This commit is contained in:
parent
91b84bf9e3
commit
c17e076767
@ -8,6 +8,8 @@ in
|
|||||||
let
|
let
|
||||||
inherit (pkgs) nixosOptionsDoc lib;
|
inherit (pkgs) nixosOptionsDoc lib;
|
||||||
|
|
||||||
|
src = builtins.toString ../.;
|
||||||
|
|
||||||
# Pretty much inspired from home-manager's documentation build process.
|
# Pretty much inspired from home-manager's documentation build process.
|
||||||
evalDoc =
|
evalDoc =
|
||||||
args@{
|
args@{
|
||||||
@ -26,11 +28,30 @@ let
|
|||||||
];
|
];
|
||||||
class = "wrapperManager";
|
class = "wrapperManager";
|
||||||
}).options;
|
}).options;
|
||||||
|
|
||||||
|
# Based from nixpkgs' and home-manager's code.
|
||||||
|
gitHubDeclaration = user: repo: subpath:
|
||||||
|
{
|
||||||
|
url = "https://github.com/${user}/${repo}/blob/master/${subpath}";
|
||||||
|
name = "<${repo}/${subpath}>";
|
||||||
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
nixosOptionsDoc (
|
nixosOptionsDoc (
|
||||||
{
|
{
|
||||||
options =
|
options =
|
||||||
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
if includeModuleSystemOptions then options else builtins.removeAttrs options [ "_module" ];
|
||||||
|
transformOptions = opt:
|
||||||
|
opt // {
|
||||||
|
declarations = map (decl:
|
||||||
|
if lib.hasPrefix src (toString decl) then
|
||||||
|
gitHubDeclaration "foo-dogsquared" "wrapper-manager-fds"
|
||||||
|
(lib.removePrefix "/" (lib.removePrefix src (toString decl)))
|
||||||
|
else if decl == "lib/modules.nix" then
|
||||||
|
gitHubDeclaration "NixOS" "nixpkgs" decl
|
||||||
|
else
|
||||||
|
decl) opt.declarations;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// builtins.removeAttrs args [
|
// builtins.removeAttrs args [
|
||||||
"modules"
|
"modules"
|
||||||
|
Loading…
Reference in New Issue
Block a user