diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-17 13:41:18 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-11-17 15:17:39 +0100 |
commit | 8b79cc00bfbe9528b7bb752a4975849c3cdf982a (patch) | |
tree | c5b9d60c9d1d2df5b75b4e77693b053a00a8a3c1 /nixos | |
parent | 0a34445d7443118d51b339e88e5184ed70a61b9b (diff) | |
download | nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar.gz nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar.bz2 nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar.lz nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar.xz nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.tar.zst nixlib-8b79cc00bfbe9528b7bb752a4975849c3cdf982a.zip |
Manual: Don't depend on the JSON options
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/default.nix | 48 | ||||
-rw-r--r-- | nixos/release.nix | 2 |
2 files changed, 22 insertions, 28 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 68248081af6a..ea1d8ffc7de5 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -30,34 +30,13 @@ let else fn; - # Convert the list of options into an XML file and a JSON file. The builtin - # unsafeDiscardStringContext is used to prevent the realisation of the store - # paths which are used in options definitions. + # Convert the list of options into an XML file. The builtin + # unsafeDiscardStringContext is used to prevent the realisation of + # the store paths which are used in options definitions. optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList')); - optionsJSON = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList')); - - # Tools-friendly version of the list of NixOS options. - options' = stdenv.mkDerivation { - name = "options"; - - buildCommand = '' - # Export list of options in different format. - dst=$out/share/doc/nixos - mkdir -p $dst - - cp ${optionsJSON} $dst/options.json - cp ${optionsXML} $dst/options.xml - - mkdir -p $out/nix-support - echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products - echo "file xml $dst/options.xml" >> $out/nix-support/hydra-build-products - ''; # */ - - meta.description = "List of NixOS options in various formats."; - }; optionsDocBook = runCommand "options-db.xml" {} '' - optionsXML=${options'}/share/doc/nixos/options.xml + optionsXML=${optionsXML} if grep /nixpkgs/nixos/modules $optionsXML; then echo "The manual appears to depend on the location of Nixpkgs, which is bad" echo "since this prevents sharing via the NixOS channel. This is typically" @@ -83,8 +62,23 @@ let in rec { - # Tools-friendly version of the list of NixOS options. - options = options'; + # The NixOS options in JSON format. + optionsJSON = stdenv.mkDerivation { + name = "options-json"; + + buildCommand = '' + # Export list of options in different format. + dst=$out/share/doc/nixos + mkdir -p $dst + + cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'))} $dst/options.json + + mkdir -p $out/nix-support + echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products + ''; # */ + + meta.description = "List of NixOS options in JSON format"; + }; # Generate the NixOS manual. manual = stdenv.mkDerivation { diff --git a/nixos/release.nix b/nixos/release.nix index 472961c27d04..ddb0b495a91f 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -130,7 +130,7 @@ in rec { manual = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manual); manualPDF = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manualPDF)).x86_64-linux; manpages = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manpages); - options = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.options)).x86_64-linux; + options = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux; # Build the initial ramdisk so Hydra can keep track of its size over time. |