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.

+8 -14
+5 -5
nixos/modules/misc/version.nix
··· 43 43 nixosVersion = mkOption { 44 44 internal = true; 45 45 type = types.str; 46 - description = "NixOS version."; 46 + description = "The full NixOS version (e.g. <literal>16.03.1160.f2d4ee1</literal>)."; 47 47 }; 48 48 49 49 nixosRelease = mkOption { 50 50 readOnly = true; 51 51 type = types.str; 52 52 default = readFile releaseFile; 53 - description = "NixOS release."; 53 + description = "The NixOS release (e.g. <literal>16.03</literal>)."; 54 54 }; 55 55 56 56 nixosVersionSuffix = mkOption { 57 57 internal = true; 58 58 type = types.str; 59 59 default = if pathExists suffixFile then readFile suffixFile else "pre-git"; 60 - description = "NixOS version suffix."; 60 + description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>)."; 61 61 }; 62 62 63 63 nixosRevision = mkOption { 64 64 internal = true; 65 65 type = types.str; 66 66 default = if pathExists revisionFile then readFile revisionFile else "master"; 67 - description = "NixOS Git revision hash."; 67 + description = "The Git revision from which this NixOS configuration was built."; 68 68 }; 69 69 70 70 nixosCodeName = mkOption { 71 71 readOnly = true; 72 72 type = types.str; 73 - description = "NixOS release code name."; 73 + description = "The NixOS release code name (e.g. <literal>Emu</literal>)."; 74 74 }; 75 75 76 76 defaultChannel = mkOption {
+3 -9
nixos/modules/services/misc/nixos-manual.nix
··· 11 11 12 12 cfg = config.services.nixosManual; 13 13 14 - versionModule = 15 - { system.nixosVersionSuffix = config.system.nixosVersionSuffix; 16 - system.nixosRevision = config.system.nixosRevision; 17 - nixpkgs.system = config.nixpkgs.system; 18 - }; 19 - 20 14 /* For the purpose of generating docs, evaluate options with each derivation 21 15 in `pkgs` (recursively) replaced by a fake with path "\${pkgs.attribute.path}". 22 16 It isn't perfect, but it seems to cover a vast majority of use cases. ··· 24 18 the path above will be shown and not e.g. `${config.services.foo.package}`. */ 25 19 manual = import ../../../doc/manual { 26 20 inherit pkgs; 27 - version = config.system.nixosVersion; 28 - revision = config.system.nixosRevision; 21 + version = config.system.nixosRelease; 22 + revision = "release-${config.system.nixosRelease}"; 29 23 options = 30 24 let 31 25 scrubbedEval = evalModules { 32 - modules = [ versionModule ] ++ baseModules; 26 + modules = [ { nixpkgs.system = config.nixpkgs.system; } ] ++ baseModules; 33 27 args = (config._module.args) // { modules = [ ]; }; 34 28 specialArgs = { pkgs = scrubDerivations "pkgs" pkgs; }; 35 29 };