summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/attrsets.nix2
-rw-r--r--nixos/release.nix28
2 files changed, 24 insertions, 6 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index 84f6cb3658b9..e3721bd1e94c 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -207,7 +207,7 @@ rec {
 
 
   /* Like `mapAttrsRecursive', but it takes an additional predicate
-     function that tells it whether to recursive into an attribute
+     function that tells it whether to recurse into an attribute
      set.  If it returns false, `mapAttrsRecursiveCond' does not
      recurse, but does apply the map function.  It is returns true, it
      does recurse, and does not apply the map function.
diff --git a/nixos/release.nix b/nixos/release.nix
index 8a502ae2baa1..780ac56edf11 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -92,15 +92,33 @@ let
   }).config));
 
 
+  cleanConfig = import ./lib/eval-config.nix {
+    system = "x86_64-linux";
+    modules = [ ];
+    pkgs = with pkgs.lib;
+      let
+        scrubDerivations = namePrefix: pkgSet: mapAttrs
+          (name: value:
+            let wholeName = "${namePrefix}.${name}"; in
+            if isAttrs value then
+              scrubDerivations wholeName value
+              // (optionalAttrs (isDerivation value) { outPath = "\${${wholeName}}"; })
+            else value
+          )
+          pkgSet;
+      in scrubDerivations "pkgs" pkgs;
+  };
+  docs = (import ./doc/manual) {
+    inherit pkgs version;
+    revision = versionModule.system.nixosRevision;
+    inherit (cleanConfig) options;
+  };
+
 in rec {
 
   channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; };
 
-  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.optionsJSON)).x86_64-linux;
-
+  inherit (docs) manual manualPDF manpages optionsJSON;
 
   # Build the initial ramdisk so Hydra can keep track of its size over time.
   initialRamdisk = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.initialRamdisk);