make-options-doc: expose Nix set

This commit is contained in:
Domen Kožar 2019-08-10 14:24:11 +02:00
parent 5cfd034af0
commit 3a93fcfd1e
No known key found for this signature in database
GPG Key ID: C2FFBCAFD2C24246

View File

@ -88,8 +88,11 @@ let
# Convert the list of options into an XML file.
optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList);
optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);
in rec {
# The NixOS options in JSON format.
inherit optionsNix;
optionsJSON = pkgs.runCommand "options.json"
{ meta.description = "List of NixOS options in JSON format";
}
@ -98,9 +101,7 @@ in rec {
dst=$out/share/doc/nixos
mkdir -p $dst
cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON
(builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList))))
} $dst/options.json
cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix))} $dst/options.json
mkdir -p $out/nix-support
echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products