mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 03:25:36 +00:00
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.
This commit is contained in:
parent
2a05368ff3
commit
83eb49220b
@ -43,34 +43,34 @@ in
|
||||
nixosVersion = mkOption {
|
||||
internal = true;
|
||||
type = types.str;
|
||||
description = "NixOS version.";
|
||||
description = "The full NixOS version (e.g. <literal>16.03.1160.f2d4ee1</literal>).";
|
||||
};
|
||||
|
||||
nixosRelease = mkOption {
|
||||
readOnly = true;
|
||||
type = types.str;
|
||||
default = readFile releaseFile;
|
||||
description = "NixOS release.";
|
||||
description = "The NixOS release (e.g. <literal>16.03</literal>).";
|
||||
};
|
||||
|
||||
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. <literal>1160.f2d4ee1</literal>).";
|
||||
};
|
||||
|
||||
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. <literal>Emu</literal>).";
|
||||
};
|
||||
|
||||
defaultChannel = mkOption {
|
||||
|
@ -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; };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user