summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2018-04-26 10:31:05 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2018-04-28 14:23:53 +0200
commit9274ea390348e17f766732e7fbd335e3bc164954 (patch)
treeea75418843caff7129e5b9b87434e59f9cac0ef1 /nixos
parent39909289f452fcd60127cbd2372f22ac35f25d08 (diff)
treewide: rename version attributes
As suggested in https://github.com/NixOS/nixpkgs/pull/39416#discussion_r183845745 the versioning attributes in `lib` should be consistent to `nixos/version` which implicates the following changes: * `lib.trivial.version` -> `lib.trivial.release` * `lib.trivial.suffix` -> `lib.trivial.versionSuffix` * `lib.nixpkgsVersion` -> `lib.version` As `lib.nixpkgsVersion` is referenced several times in `NixOS/nixpkgs`, `NixOS/nix` and probably several user's setups. As the rename will cause a notable impact it's better to keep `lib.nixpkgsVersion` as alias with a warning yielded by `builtins.trace`.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/release-notes/rl-1809.xml5
-rwxr-xr-xnixos/maintainers/scripts/ec2/create-amis.sh2
-rw-r--r--nixos/modules/misc/version.nix4
3 files changed, 8 insertions, 3 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml
index 2e53f0563baf..949dbf0e0c1e 100644
--- a/nixos/doc/manual/release-notes/rl-1809.xml
+++ b/nixos/doc/manual/release-notes/rl-1809.xml
@@ -123,6 +123,11 @@ following incompatible changes:</para>
<literal>lib.traceCallXml</literal> has been deprecated. Please complain
if you use the function regularly.
</para>
+ <para>
+ The attribute <literal>lib.nixpkgsVersion</literal> has been deprecated in favor of
+ <literal>lib.version</literal>. Please refer to the discussion in
+ <link xlink:href="https://github.com/NixOS/nixpkgs/pull/39416#discussion_r183845745">NixOS/nixpkgs#39416</link> for further reference.
+ </para>
</listitem>
</itemizedlist>
diff --git a/nixos/maintainers/scripts/ec2/create-amis.sh b/nixos/maintainers/scripts/ec2/create-amis.sh
index 347e6b9c6e0d..9461144fad5a 100755
--- a/nixos/maintainers/scripts/ec2/create-amis.sh
+++ b/nixos/maintainers/scripts/ec2/create-amis.sh
@@ -6,7 +6,7 @@
set -e
set -o pipefail
-version=$(nix-instantiate --eval --strict '<nixpkgs>' -A lib.nixpkgsVersion | sed s/'"'//g)
+version=$(nix-instantiate --eval --strict '<nixpkgs>' -A lib.version | sed s/'"'//g)
major=${version:0:5}
echo "NixOS version is $version ($major)"
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index d9d60b725093..74c86443ab90 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -23,14 +23,14 @@ in
nixos.release = mkOption {
readOnly = true;
type = types.str;
- default = trivial.version;
+ default = trivial.release;
description = "The NixOS release (e.g. <literal>16.03</literal>).";
};
nixos.versionSuffix = mkOption {
internal = true;
type = types.str;
- default = trivial.suffix;
+ default = trivial.versionSuffix;
description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>).";
};