From 3c15d578d4271142d7e596b9dc708cf07da48fa8 Mon Sep 17 00:00:00 2001 From: Dima Date: Sat, 23 Nov 2019 15:21:25 +0100 Subject: [PATCH] make-options-doc: fix string context issues When using `documentation.nixos.includeAllModules = true;` with external modules, the string context might contain dependencies to derivations and so `toFile` refuses to evaluate; ``` error: in 'toFile': the file 'options.xml' cannot refer to derivation outputs, at [...]/nixpkgs/nixos/lib/make-options-doc/default.nix:89:16 ``` This is not an issue when using `writeText` (instead of manually stripping the context). --- nixos/lib/make-options-doc/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 35c8b543dec..eee8f612410 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -86,7 +86,7 @@ let optionsList = lib.sort optionLess optionsListDesc; # Convert the list of options into an XML file. - optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList); + optionsXML = pkgs.writeText "options.xml" (builtins.toXML optionsList); optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);