From 83eb49220b4a91658b710d7095899d04856875a3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 28 Jul 2016 18:27:03 +0200 Subject: [PATCH] Manual: Only include the release number (e.g. 16.03) This prevents gratuitous rebuilds of the manual every time the Git revision changes. Should help a bit with #17261. --- nixos/modules/misc/version.nix | 10 +++++----- nixos/modules/services/misc/nixos-manual.nix | 12 +++--------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix index 9158d82a73a..6d4d3a9eea3 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -43,34 +43,34 @@ in nixosVersion = mkOption { internal = true; type = types.str; - description = "NixOS version."; + description = "The full NixOS version (e.g. 16.03.1160.f2d4ee1)."; }; nixosRelease = mkOption { readOnly = true; type = types.str; default = readFile releaseFile; - description = "NixOS release."; + description = "The NixOS release (e.g. 16.03)."; }; nixosVersionSuffix = mkOption { internal = true; type = types.str; default = if pathExists suffixFile then readFile suffixFile else "pre-git"; - description = "NixOS version suffix."; + description = "The NixOS version suffix (e.g. 1160.f2d4ee1)."; }; nixosRevision = mkOption { internal = true; type = types.str; default = if pathExists revisionFile then readFile revisionFile else "master"; - description = "NixOS Git revision hash."; + description = "The Git revision from which this NixOS configuration was built."; }; nixosCodeName = mkOption { readOnly = true; type = types.str; - description = "NixOS release code name."; + description = "The NixOS release code name (e.g. Emu)."; }; defaultChannel = mkOption { diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix index 37ea339300d..a60d5f7983b 100644 --- a/nixos/modules/services/misc/nixos-manual.nix +++ b/nixos/modules/services/misc/nixos-manual.nix @@ -11,12 +11,6 @@ let cfg = config.services.nixosManual; - versionModule = - { system.nixosVersionSuffix = config.system.nixosVersionSuffix; - system.nixosRevision = config.system.nixosRevision; - nixpkgs.system = config.nixpkgs.system; - }; - /* For the purpose of generating docs, evaluate options with each derivation in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}". It isn't perfect, but it seems to cover a vast majority of use cases. @@ -24,12 +18,12 @@ let the path above will be shown and not e.g. `${config.services.foo.package}`. */ manual = import ../../../doc/manual { inherit pkgs; - version = config.system.nixosVersion; - revision = config.system.nixosRevision; + version = config.system.nixosRelease; + revision = "release-${config.system.nixosRelease}"; options = let scrubbedEval = evalModules { - modules = [ versionModule ] ++ baseModules; + modules = [ { nixpkgs.system = config.nixpkgs.system; } ] ++ baseModules; args = (config._module.args) // { modules = [ ]; }; specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; }; };