summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24 19:58:34 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-24 19:58:34 +0200
commit20150b1cee1ec86e50e2e1c2a75d45499ccd80d4 (patch)
treecc705e1007b0bee6167610dffa72fa6d07f3f6e4 /nixos/modules
parentd5af9bc5831b73b87c2d20b014f03b416a981327 (diff)
downloadnixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar.gz
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar.bz2
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar.lz
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar.xz
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.tar.zst
nixlib-20150b1cee1ec86e50e2e1c2a75d45499ccd80d4.zip
Ensure that the manual job gets build with the right revision info
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/misc/version.nix10
-rw-r--r--nixos/modules/services/misc/nixos-manual.nix11
2 files changed, 17 insertions, 4 deletions
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index 2a0b95ebeb60..5ab24686152e 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -18,6 +18,12 @@ with pkgs.lib;
       description = "NixOS version suffix.";
     };
 
+    system.nixosRevision = mkOption {
+      internal = true;
+      type = types.uniq types.string;
+      description = "NixOS Git revision hash.";
+    };
+
     system.nixosCodeName = mkOption {
       internal = true;
       type = types.uniq types.string;
@@ -42,6 +48,10 @@ with pkgs.lib;
       let suffixFile = "${toString pkgs.path}/.version-suffix"; in
       mkDefault (if pathExists suffixFile then readFile suffixFile else "pre-git");
 
+    system.nixosRevision =
+      let fn = "${toString pkgs.path}/.git-revision"; in
+      mkDefault (if pathExists fn then readFile fn else "master");
+
     # Note: code names must only increase in alphabetical order.
     system.nixosCodeName = "Aardvark";
 
diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix
index c522868c1d98..a593d05ee628 100644
--- a/nixos/modules/services/misc/nixos-manual.nix
+++ b/nixos/modules/services/misc/nixos-manual.nix
@@ -11,12 +11,15 @@ let
 
   cfg = config.services.nixosManual;
 
+  versionModule =
+    { system.nixosVersionSuffix = config.system.nixosVersionSuffix;
+      system.nixosRevision = config.system.nixosRevision;
+    };
+
   manual = import ../../../doc/manual {
     inherit pkgs;
-    revision =
-      let fn = "${toString pkgs.path}/.git-revision";
-      in if pathExists fn then readFile fn else "master";
-    options = (fixMergeModules baseModules
+    revision = config.system.nixosRevision;
+    options = (fixMergeModules ([ versionModule ] ++ baseModules)
       (removeAttrs extraArgs ["config" "options"]) // {
         modules = [ ];
       }).options;