feat(docs): Add home-manager module options to the docs

This commit is contained in:
Jalil David Salamé Messina 2024-01-15 14:43:46 +01:00
parent 8e27b9ee60
commit b036df017c
Signed by: jalil
GPG key ID: F016B9E770737A0B
6 changed files with 22 additions and 11 deletions

View file

@ -1,17 +1,18 @@
{ pkgs, lib, ... }:
{ pkgs, lib, markdown }:
let
eval = lib.evalModules { modules = [ ../nixos/options.nix ]; };
markdown = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
nixos-markdown = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
in
{
inherit markdown;
markdown = nixos-markdown;
docs = pkgs.stdenvNoCC.mkDerivation {
name = "nixos-configuration-book";
src = ./.;
patchPhase = ''
# copy generated options removing the declared by statement
sed '/^\*Declared by:\*$/,/^$/d' <${markdown} >> src/options.md
sed '/^\*Declared by:\*$/,/^$/d' <${markdown} >> src/home-options.md
sed '/^\*Declared by:\*$/,/^$/d' <${nixos-markdown} >> src/nixos-options.md
'';
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";

View file

@ -1,3 +1,4 @@
# Summary
- [Module Options](./options.md)
- [NixOS Module Options](./nixos-options.md)
- [Home Manager Module Options](./home-options.md)

3
docs/src/home-options.md Normal file
View file

@ -0,0 +1,3 @@
# Home Manager Module Options
Here you will find the home-manager options and their default values (if they have any).

View file

@ -0,0 +1,3 @@
# NixOS Module Options
Here you will find the NixOS module options and their default values (if they have any).

View file

@ -1,3 +0,0 @@
# Module Options
Here you will find the module options and their default values (if they have any).