Skip to content

Commit

Permalink
make-options-doc: fix string context issues
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
d-goldin committed Nov 23, 2019
1 parent 7c5b287 commit 3c15d57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/lib/make-options-doc/default.nix
Expand Up @@ -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);

Expand Down

0 comments on commit 3c15d57

Please sign in to comment.