File tree Expand file tree Collapse file tree 4 files changed +71
-86
lines changed
Expand file tree Collapse file tree 4 files changed +71
-86
lines changed Original file line number Diff line number Diff line change 3535 ./modules/formatting.nix
3636 ./modules/integration-tests
3737 ./modules/nci.nix
38- ./modules/nixos-manual
38+ ./modules/nixos-manual.nix
3939 ./modules/nixos-modules-lib.nix
4040 ./modules/private-nixos-modules
4141 ./modules/program-docs.nix
Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ self ,
4+ ...
5+ } :
6+ {
7+ perSystem =
8+ {
9+ self' ,
10+ system ,
11+ pkgs ,
12+ ...
13+ } :
14+ let
15+ filterOptions = import ../filterOptions.nix lib ;
16+
17+ configuration = lib . nixosSystem {
18+ modules = [
19+ self . nixosModules . api
20+ self . nixosModules . fetcher
21+ {
22+ nixpkgs . hostPlatform = system ;
23+ }
24+ ] ;
25+ } ;
26+
27+ options = filterOptions (
28+ path : option : lib . any ( lib . hasPrefix "${ self } /" ) option . declarations
29+ ) configuration . options ;
30+
31+ optionsDocs = pkgs . buildPackages . nixosOptionsDoc {
32+ inherit options ;
33+ variablelistId = "options" ;
34+ transformOptions = options : builtins . removeAttrs options [ "declarations" ] ;
35+ } ;
36+
37+ optionsMd =
38+ pkgs . runCommand "pr-tracker-nixos-options-html" { nativeBuildInputs = [ pkgs . nixos-render-docs ] ; }
39+ ''
40+ nixos-render-docs options commonmark \
41+ --manpage-urls <(echo "{}") \
42+ --revision provide-because-required-but-seems-to-be-unused \
43+ ${ optionsDocs . optionsJSON } /share/doc/nixos/options.json $out
44+ '' ;
45+
46+ summaryMd = pkgs . writeTextFile {
47+ name = "SUMMARY.md" ;
48+ text =
49+ # markdown
50+ ''
51+ [Options](options.md)
52+ '' ;
53+ } ;
54+ in
55+ {
56+ packages . nixos-manual =
57+ pkgs . runCommand "pr-tracker-nixos-manual"
58+ {
59+ nativeBuildInputs = [ pkgs . mdbook ] ;
60+ }
61+ ''
62+ mkdir src
63+ ln -s ${ summaryMd } src/SUMMARY.md
64+ ln -s ${ optionsMd } src/options.md
65+ mdbook build --dest-dir $out
66+ '' ;
67+
68+ checks . "packages/nixos-modules-manual" = self' . packages . nixos-manual ;
69+ } ;
70+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments