Ensure that the manual job gets build with the right revision info

This commit is contained in:
Eelco Dolstra 2013-10-24 19:58:34 +02:00
parent d5af9bc583
commit 20150b1cee
3 changed files with 20 additions and 5 deletions

View File

@ -18,6 +18,12 @@ with pkgs.lib;
description = "NixOS version suffix."; description = "NixOS version suffix.";
}; };
system.nixosRevision = mkOption {
internal = true;
type = types.uniq types.string;
description = "NixOS Git revision hash.";
};
system.nixosCodeName = mkOption { system.nixosCodeName = mkOption {
internal = true; internal = true;
type = types.uniq types.string; type = types.uniq types.string;
@ -42,6 +48,10 @@ with pkgs.lib;
let suffixFile = "${toString pkgs.path}/.version-suffix"; in let suffixFile = "${toString pkgs.path}/.version-suffix"; in
mkDefault (if pathExists suffixFile then readFile suffixFile else "pre-git"); 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. # Note: code names must only increase in alphabetical order.
system.nixosCodeName = "Aardvark"; system.nixosCodeName = "Aardvark";

View File

@ -11,12 +11,15 @@ let
cfg = config.services.nixosManual; cfg = config.services.nixosManual;
versionModule =
{ system.nixosVersionSuffix = config.system.nixosVersionSuffix;
system.nixosRevision = config.system.nixosRevision;
};
manual = import ../../../doc/manual { manual = import ../../../doc/manual {
inherit pkgs; inherit pkgs;
revision = revision = config.system.nixosRevision;
let fn = "${toString pkgs.path}/.git-revision"; options = (fixMergeModules ([ versionModule ] ++ baseModules)
in if pathExists fn then readFile fn else "master";
options = (fixMergeModules baseModules
(removeAttrs extraArgs ["config" "options"]) // { (removeAttrs extraArgs ["config" "options"]) // {
modules = [ ]; modules = [ ];
}).options; }).options;

View File

@ -16,7 +16,9 @@ let
versionModule = versionModule =
{ system.nixosVersionSuffix = versionSuffix; }; { system.nixosVersionSuffix = versionSuffix;
system.nixosRevision = nixpkgs.rev or nixpkgs.shortRev;
};
makeIso = makeIso =