···3030 else
3131 fn;
32323333- # Convert the list of options into an XML file and a JSON file. The builtin
3434- # unsafeDiscardStringContext is used to prevent the realisation of the store
3535- # paths which are used in options definitions.
3333+ # Convert the list of options into an XML file. The builtin
3434+ # unsafeDiscardStringContext is used to prevent the realisation of
3535+ # the store paths which are used in options definitions.
3636 optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList'));
3737- optionsJSON = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'));
3838-3939- # Tools-friendly version of the list of NixOS options.
4040- options' = stdenv.mkDerivation {
4141- name = "options";
4242-4343- buildCommand = ''
4444- # Export list of options in different format.
4545- dst=$out/share/doc/nixos
4646- mkdir -p $dst
4747-4848- cp ${optionsJSON} $dst/options.json
4949- cp ${optionsXML} $dst/options.xml
5050-5151- mkdir -p $out/nix-support
5252- echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
5353- echo "file xml $dst/options.xml" >> $out/nix-support/hydra-build-products
5454- ''; # */
5555-5656- meta.description = "List of NixOS options in various formats.";
5757- };
58375938 optionsDocBook = runCommand "options-db.xml" {} ''
6060- optionsXML=${options'}/share/doc/nixos/options.xml
3939+ optionsXML=${optionsXML}
6140 if grep /nixpkgs/nixos/modules $optionsXML; then
6241 echo "The manual appears to depend on the location of Nixpkgs, which is bad"
6342 echo "since this prevents sharing via the NixOS channel. This is typically"
···83628463in rec {
85648686- # Tools-friendly version of the list of NixOS options.
8787- options = options';
6565+ # The NixOS options in JSON format.
6666+ optionsJSON = stdenv.mkDerivation {
6767+ name = "options-json";
6868+6969+ buildCommand = ''
7070+ # Export list of options in different format.
7171+ dst=$out/share/doc/nixos
7272+ mkdir -p $dst
7373+7474+ cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'))} $dst/options.json
7575+7676+ mkdir -p $out/nix-support
7777+ echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
7878+ ''; # */
7979+8080+ meta.description = "List of NixOS options in JSON format";
8181+ };
88828983 # Generate the NixOS manual.
9084 manual = stdenv.mkDerivation {