@@ -30,34 +30,13 @@ let
33− # Convert the list of options into an XML file and a JSON file. The builtin
33+ # Convert the list of options into an XML file. The builtin
34− # unsafeDiscardStringContext is used to prevent the realisation of the store
34+ # unsafeDiscardStringContext is used to prevent the realisation of
35− # paths which are used in options definitions.
35+ # the store paths which are used in options definitions.
36 optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList'));
36 optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList'));
37− optionsJSON = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'));
39− # Tools-friendly version of the list of NixOS options.
40− options' = stdenv.mkDerivation {
44− # Export list of options in different format.
45− dst=$out/share/doc/nixos
48− cp ${optionsJSON} $dst/options.json
49− cp ${optionsXML} $dst/options.xml
51− mkdir -p $out/nix-support
52− echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
53− echo "file xml $dst/options.xml" >> $out/nix-support/hydra-build-products
56− meta.description = "List of NixOS options in various formats.";
59 optionsDocBook = runCommand "options-db.xml" {} ''
38 optionsDocBook = runCommand "options-db.xml" {} ''
60− optionsXML=${options'}/share/doc/nixos/options.xml
39+ optionsXML=${optionsXML}
61 if grep /nixpkgs/nixos/modules $optionsXML; then
40 if grep /nixpkgs/nixos/modules $optionsXML; then
62 echo "The manual appears to depend on the location of Nixpkgs, which is bad"
41 echo "The manual appears to depend on the location of Nixpkgs, which is bad"
63 echo "since this prevents sharing via the NixOS channel. This is typically"
42 echo "since this prevents sharing via the NixOS channel. This is typically"
@@ -83,8 +62,23 @@ let
86− # Tools-friendly version of the list of NixOS options.
65+ # The NixOS options in JSON format.
87− options = options';
66+ optionsJSON = stdenv.mkDerivation {
67+ name = "options-json";
70+ # Export list of options in different format.
71+ dst=$out/share/doc/nixos
74+ cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'))} $dst/options.json
76+ mkdir -p $out/nix-support
77+ echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
80+ meta.description = "List of NixOS options in JSON format";
89 # Generate the NixOS manual.
83 # Generate the NixOS manual.
90 manual = stdenv.mkDerivation {
84 manual = stdenv.mkDerivation {