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