From df09c21fb262ed07f01099625ef9310a8a8392ae Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 15 Jan 2023 14:56:46 +0100 Subject: nixos/documentation: deprecate docbook option docs following the plan in https://github.com/NixOS/nixpkgs/pull/189318#discussion_r961764451 also adds an activation script to print the warning during activation instead of during build, otherwise folks using the new CLI that hides build logs by default might never see the warning. --- nixos/modules/misc/documentation.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nixos/modules/misc') diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index e44a9899772f..ecc40ad6adef 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -357,6 +357,14 @@ 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 ]; -- cgit 1.4.1