mirror of
https://github.com/youwen5/nixos.git
synced 2025-03-03 07:31:11 -08:00
feat: add documentation auto generation
This commit is contained in:
parent
9c930ee34f
commit
436c14233c
2 changed files with 29 additions and 0 deletions
27
docs/default.nix
Normal file
27
docs/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
runCommand,
|
||||||
|
nixosOptionsDoc,
|
||||||
|
neovim,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
# evaluate our options
|
||||||
|
eval = lib.evalModules {
|
||||||
|
modules = [ ../modules/default.nix ];
|
||||||
|
check = false;
|
||||||
|
specialArgs = {
|
||||||
|
pkgs = {
|
||||||
|
inherit neovim;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# generate our docs
|
||||||
|
optionsDoc = nixosOptionsDoc {
|
||||||
|
inherit (eval) options;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
# create a derivation for capturing the markdown output
|
||||||
|
runCommand "options-doc.md" { } ''
|
||||||
|
tail -n +64 ${optionsDoc.optionsCommonMark} >> $out
|
||||||
|
''
|
|
@ -225,6 +225,8 @@
|
||||||
marksman
|
marksman
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
packages.docs = pkgs.callPackage ./docs { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue