Loading nixos/doc/manual/default.nix +22 −14 Original line number Diff line number Diff line Loading @@ -9,12 +9,20 @@ , prefix ? ../../.. }: with pkgs; let inherit (lib) hasPrefix removePrefix; lib = pkgs.lib; inherit (pkgs) buildPackages runCommand docbook_xsl_ns; inherit (pkgs.lib) hasPrefix removePrefix flip foldr types mkOption escapeShellArg concatMapStringsSep sourceFilesBySuffices ; common = import ./common.nix; Loading @@ -27,7 +35,7 @@ let # E.g. if some `options` came from modules in ${pkgs.customModules}/nix, # you'd need to include `extraSources = [ pkgs.customModules ]` prefixesToStrip = map (p: "${toString p}/") ([ prefix ] ++ extraSources); stripAnyPrefixes = lib.flip (lib.foldr lib.removePrefix) prefixesToStrip; stripAnyPrefixes = flip (foldr removePrefix) prefixesToStrip; optionsDoc = buildPackages.nixosOptionsDoc { inherit options revision baseOptionsJSON warningsAreErrors; Loading @@ -42,8 +50,8 @@ let testOptionsDoc = let eval = nixos-lib.evalTest { # Avoid evaluating a NixOS config prototype. config.node.type = lib.types.deferredModule; options._module.args = lib.mkOption { internal = true; }; config.node.type = types.deferredModule; options._module.args = mkOption { internal = true; }; }; in buildPackages.nixosOptionsDoc { inherit (eval) options; Loading Loading @@ -76,7 +84,7 @@ let substituteInPlace ./configuration/configuration.md \ --replace \ '@MODULE_CHAPTERS@' \ ${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)} ${escapeShellArg (concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)} substituteInPlace ./nixos-options.md \ --replace \ '@NIXOS_OPTIONS_JSON@' \ Loading @@ -95,7 +103,7 @@ in rec { # Generate the NixOS manual. manualHTML = runCommand "nixos-manual-html" { nativeBuildInputs = [ buildPackages.nixos-render-docs ]; inputs = lib.sourceFilesBySuffices ./. [ ".md" ]; inputs = sourceFilesBySuffices ./. [ ".md" ]; meta.description = "The NixOS manual in HTML format"; allowedReferences = ["out"]; } Loading @@ -114,8 +122,8 @@ in rec { nixos-render-docs -j $NIX_BUILD_CORES manual html \ --manpage-urls ${manpageUrls} \ --revision ${lib.escapeShellArg revision} \ --generator "nixos-render-docs ${lib.version}" \ --revision ${escapeShellArg revision} \ --generator "nixos-render-docs ${pkgs.lib.version}" \ --stylesheet style.css \ --stylesheet highlightjs/mono-blue.css \ --script ./highlightjs/highlight.pack.js \ Loading Loading @@ -147,7 +155,7 @@ in rec { xml:id="book-nixos-manual"> <info> <title>NixOS Manual</title> <subtitle>Version ${lib.version}</subtitle> <subtitle>Version ${pkgs.lib.version}</subtitle> </info> <chapter> <title>Temporarily unavailable</title> Loading Loading @@ -199,7 +207,7 @@ in rec { # Generate manpages. mkdir -p $out/share/man/man5 nixos-render-docs -j $NIX_BUILD_CORES options manpage \ --revision ${lib.escapeShellArg revision} \ --revision ${escapeShellArg revision} \ ${optionsJSON}/${common.outputPath}/options.json \ $out/share/man/man5/configuration.nix.5 ''; Loading Loading
nixos/doc/manual/default.nix +22 −14 Original line number Diff line number Diff line Loading @@ -9,12 +9,20 @@ , prefix ? ../../.. }: with pkgs; let inherit (lib) hasPrefix removePrefix; lib = pkgs.lib; inherit (pkgs) buildPackages runCommand docbook_xsl_ns; inherit (pkgs.lib) hasPrefix removePrefix flip foldr types mkOption escapeShellArg concatMapStringsSep sourceFilesBySuffices ; common = import ./common.nix; Loading @@ -27,7 +35,7 @@ let # E.g. if some `options` came from modules in ${pkgs.customModules}/nix, # you'd need to include `extraSources = [ pkgs.customModules ]` prefixesToStrip = map (p: "${toString p}/") ([ prefix ] ++ extraSources); stripAnyPrefixes = lib.flip (lib.foldr lib.removePrefix) prefixesToStrip; stripAnyPrefixes = flip (foldr removePrefix) prefixesToStrip; optionsDoc = buildPackages.nixosOptionsDoc { inherit options revision baseOptionsJSON warningsAreErrors; Loading @@ -42,8 +50,8 @@ let testOptionsDoc = let eval = nixos-lib.evalTest { # Avoid evaluating a NixOS config prototype. config.node.type = lib.types.deferredModule; options._module.args = lib.mkOption { internal = true; }; config.node.type = types.deferredModule; options._module.args = mkOption { internal = true; }; }; in buildPackages.nixosOptionsDoc { inherit (eval) options; Loading Loading @@ -76,7 +84,7 @@ let substituteInPlace ./configuration/configuration.md \ --replace \ '@MODULE_CHAPTERS@' \ ${lib.escapeShellArg (lib.concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)} ${escapeShellArg (concatMapStringsSep "\n" (p: "${p.value}") config.meta.doc)} substituteInPlace ./nixos-options.md \ --replace \ '@NIXOS_OPTIONS_JSON@' \ Loading @@ -95,7 +103,7 @@ in rec { # Generate the NixOS manual. manualHTML = runCommand "nixos-manual-html" { nativeBuildInputs = [ buildPackages.nixos-render-docs ]; inputs = lib.sourceFilesBySuffices ./. [ ".md" ]; inputs = sourceFilesBySuffices ./. [ ".md" ]; meta.description = "The NixOS manual in HTML format"; allowedReferences = ["out"]; } Loading @@ -114,8 +122,8 @@ in rec { nixos-render-docs -j $NIX_BUILD_CORES manual html \ --manpage-urls ${manpageUrls} \ --revision ${lib.escapeShellArg revision} \ --generator "nixos-render-docs ${lib.version}" \ --revision ${escapeShellArg revision} \ --generator "nixos-render-docs ${pkgs.lib.version}" \ --stylesheet style.css \ --stylesheet highlightjs/mono-blue.css \ --script ./highlightjs/highlight.pack.js \ Loading Loading @@ -147,7 +155,7 @@ in rec { xml:id="book-nixos-manual"> <info> <title>NixOS Manual</title> <subtitle>Version ${lib.version}</subtitle> <subtitle>Version ${pkgs.lib.version}</subtitle> </info> <chapter> <title>Temporarily unavailable</title> Loading Loading @@ -199,7 +207,7 @@ in rec { # Generate manpages. mkdir -p $out/share/man/man5 nixos-render-docs -j $NIX_BUILD_CORES options manpage \ --revision ${lib.escapeShellArg revision} \ --revision ${escapeShellArg revision} \ ${optionsJSON}/${common.outputPath}/options.json \ $out/share/man/man5/configuration.nix.5 ''; Loading