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