git.iko.soy/typeable/nixpkgs
on master help sign in
Manual: Don't depend on the JSON options
commit8b79cc00bfbe9528b7bb752a4975849c3cdf982a authorEelco Dolstra <eelco.dolstra@logicblox.com> dateMon 17 Nov 2014, 13:41 (12 years ago) parent0a34445
2 files changed+22−28
nixos/doc/manual/default.nix+21−27 nixos/release.nix+1−1
nixos/doc/manual/default.nix+21−27
@@ -30,34 +30,13 @@ let
3030 else
3131 fn;
3232
33− # Convert the list of options into an XML file and a JSON file. The builtin
34− # unsafeDiscardStringContext is used to prevent the realisation of the store
35− # paths which are used in options definitions.
33+ # Convert the list of options into an XML file. The builtin
34+ # unsafeDiscardStringContext is used to prevent the realisation of
35+ # the store paths which are used in options definitions.
3636 optionsXML = builtins.toFile "options.xml" (builtins.unsafeDiscardStringContext (builtins.toXML optionsList'));
37− optionsJSON = builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'));
38−
39− # Tools-friendly version of the list of NixOS options.
40− options' = stdenv.mkDerivation {
41− name = "options";
42−
43− buildCommand = ''
44− # Export list of options in different format.
45− dst=$out/share/doc/nixos
46− mkdir -p $dst
47−
48− cp ${optionsJSON} $dst/options.json
49− cp ${optionsXML} $dst/options.xml
50−
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
54− ''; # */
55−
56− meta.description = "List of NixOS options in various formats.";
57− };
5837
5938 optionsDocBook = runCommand "options-db.xml" {} ''
60− optionsXML=${options'}/share/doc/nixos/options.xml
39+ 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"
@@ -83,8 +62,23 @@ let
8362
8463in rec {
8564
86− # Tools-friendly version of the list of NixOS options.
87− options = options';
65+ # The NixOS options in JSON format.
66+ optionsJSON = stdenv.mkDerivation {
67+ name = "options-json";
68+
69+ buildCommand = ''
70+ # Export list of options in different format.
71+ dst=$out/share/doc/nixos
72+ mkdir -p $dst
73+
74+ cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsList'))} $dst/options.json
75+
76+ mkdir -p $out/nix-support
77+ echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products
78+ ''; # */
79+
80+ meta.description = "List of NixOS options in JSON format";
81+ };
8882
8983 # Generate the NixOS manual.
9084 manual = stdenv.mkDerivation {
nixos/release.nix+1−1
@@ -130,7 +130,7 @@ in rec {
130130 manual = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manual);
131131 manualPDF = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manualPDF)).x86_64-linux;
132132 manpages = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manpages);
133− options = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.options)).x86_64-linux;
133+ options = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.optionsJSON)).x86_64-linux;
134134
135135
136136 # Build the initial ramdisk so Hydra can keep track of its size over time.