From 2872e103333eb910cf015c36dbab5911f3630f95 Mon Sep 17 00:00:00 2001 From: emilylange Date: Sun, 21 Apr 2024 16:53:29 +0200 Subject: [PATCH] nixos/manual: apply `cfg.warningsAreErrors` to nix eval as well This change makes `baseOptionsJSON` (`lazy-option.json`) take our existing `documentation.nixos.options.warningsAreErrors` option into account to then set the `NIX_ABORT_ON_WARN` environment variable within its build sandbox accordingly. Given `documentation.nixos.options.warningsAreErrors` default to true, our nixpkgs CI check that builds the NixOS manual for each PR, will now fail when something raises a warning, e.g. as part of the `lib.mdDoc` deprecation. This should prevent new PRs with lib.mdDoc from getting merged. Previously, the manual would build successfully, even if an eval warning was raised. --- nixos/modules/misc/documentation.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/misc/documentation.nix b/nixos/modules/misc/documentation.nix index 2a25f8e56468..26323e14b901 100644 --- a/nixos/modules/misc/documentation.nix +++ b/nixos/modules/misc/documentation.nix @@ -101,6 +101,7 @@ let libPath = filter (pkgs.path + "/lib"); pkgsLibPath = filter (pkgs.path + "/pkgs/pkgs-lib"); nixosPath = filter (pkgs.path + "/nixos"); + NIX_ABORT_ON_WARN = warningsAreErrors; modules = "[ " + concatMapStringsSep " " (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy