Generate docs (#1)
* feat: Reorganize code * feat: Generate docs as mdbook * feat: Add deploy github action * fix: formatting
This commit is contained in:
parent
ca6bf00ad6
commit
63034a2af9
11 changed files with 144 additions and 70 deletions
16
docs/default.nix
Normal file
16
docs/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
eval = lib.evalModules { modules = [ ../options.nix ]; };
|
||||
doc = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
|
||||
in
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "nixos-configuration-book";
|
||||
src = ./.;
|
||||
|
||||
patchPhase = ''
|
||||
# copy generated options removing the declared by statement
|
||||
sed '/^\*Declared by:\*$/,/^$/d' <${doc} >> src/options.md
|
||||
'';
|
||||
|
||||
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue