From f52f531a4e4791f79902ed3f4162bfd8ae899c01 Mon Sep 17 00:00:00 2001 From: pennae Date: Tue, 13 Jun 2023 12:21:38 +0200 Subject: [PATCH] nixos/make-options-doc: deprecate docbook outputs they're no longer necessary for us and will almost definitely start to rot now (like commonmark and asciidoc outputs did previously). most existing users seem to take the docbook output and run it through pandoc to generate html, those can easily migrate to use commonmark instead. other users will hopefully pipe up when they notice that things they rely on are going away. optionsUsedDocbook has only been around for one release and only exposed to allow other places to generate warnings, so that does not deserve such precautions. --- nixos/doc/manual/default.nix | 2 +- nixos/lib/make-options-doc/default.nix | 37 +++++++++++--------------- nixos/modules/misc/documentation.nix | 8 ------ 3 files changed, 16 insertions(+), 31 deletions(-) diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index cc28fe6d16ca..ef7803fb75b0 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -198,7 +198,7 @@ let ''; in rec { - inherit (optionsDoc) optionsJSON optionsNix optionsDocBook optionsUsedDocbook; + inherit (optionsDoc) optionsJSON optionsNix optionsDocBook; # Generate the NixOS manual. manualHTML = runCommand "nixos-manual-html" diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 26819597a1f9..99515b5b8276 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -157,26 +157,19 @@ in rec { echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products ''; - optionsUsedDocbook = pkgs.runCommand "options-used-docbook" {} '' - if [ -e ${optionsJSON}/share/doc/nixos/.used-docbook ]; then - echo 1 - else - echo 0 - fi >"$out" - ''; - - optionsDocBook = pkgs.runCommand "options-docbook.xml" { - nativeBuildInputs = [ - pkgs.nixos-render-docs - ]; - } '' - nixos-render-docs -j $NIX_BUILD_CORES options docbook \ - --manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \ - --revision ${lib.escapeShellArg revision} \ - --document-type ${lib.escapeShellArg documentType} \ - --varlist-id ${lib.escapeShellArg variablelistId} \ - --id-prefix ${lib.escapeShellArg optionIdPrefix} \ - ${optionsJSON}/share/doc/nixos/options.json \ - "$out" - ''; + optionsDocBook = lib.warn "optionsDocBook is deprecated since 23.11 and will be removed in 24.05" + (pkgs.runCommand "options-docbook.xml" { + nativeBuildInputs = [ + pkgs.nixos-render-docs + ]; + } '' + nixos-render-docs -j $NIX_BUILD_CORES options docbook \ + --manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \ + --revision ${lib.escapeShellArg revision} \ + --document-type ${lib.escapeShellArg documentType} \ + --varlist-id ${lib.escapeShellArg variablelistId} \ + --id-prefix ${lib.escapeShellArg optionIdPrefix} \ + ${optionsJSON}/share/doc/nixos/options.json \ + "$out" + ''); } diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index e6a56a8cdf28..820450e3ce2a 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -345,14 +345,6 @@ in (mkIf cfg.nixos.enable { system.build.manual = manual; - system.activationScripts.check-manual-docbook = '' - if [[ $(cat ${manual.optionsUsedDocbook}) = 1 ]]; then - echo -e "\e[31;1mwarning\e[0m: This configuration contains option documentation in docbook." \ - "Support for docbook is deprecated and will be removed after NixOS 23.05." \ - "See nix-store --read-log ${builtins.unsafeDiscardStringContext manual.optionsJSON.drvPath}" - fi - ''; - environment.systemPackages = [] ++ optional cfg.man.enable manual.manpages ++ optionals cfg.doc.enable [ manual.manualHTML nixos-help ];