diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2018-04-30 08:33:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 08:33:19 +0000 |
commit | fd8dcdfa9d3262429ff0ec2ea2d05cd894295740 (patch) | |
tree | c979d94e0eaa4bcbaa39c047fcdef18157ddfee8 /nixos | |
parent | 9b70630b9baaf923928e9a09811aaf298cd88542 (diff) | |
parent | 9274ea390348e17f766732e7fbd335e3bc164954 (diff) | |
download | nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar.gz nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar.bz2 nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar.lz nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar.xz nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.tar.zst nixpkgs-fd8dcdfa9d3262429ff0ec2ea2d05cd894295740.zip |
Merge pull request #39416 from Ma27/fix-.version-config
.version: don't read from `.version` and deduplicate `.version-suffix` references
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-1809.xml | 5 | ||||
-rwxr-xr-x | nixos/maintainers/scripts/ec2/create-amis.sh | 2 | ||||
-rw-r--r-- | nixos/modules/misc/version.nix | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index 62f1b769463..ce06a23beba 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -132,6 +132,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 347e6b9c6e0..9461144fad5 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 b8f0a223c91..74c86443ab9 100644 --- a/nixos/modules/misc/version.nix +++ b/nixos/modules/misc/version.nix @@ -5,8 +5,6 @@ with lib; let cfg = config.system.nixos; - releaseFile = "${toString pkgs.path}/.version"; - suffixFile = "${toString pkgs.path}/.version-suffix"; revisionFile = "${toString pkgs.path}/.git-revision"; gitRepo = "${toString pkgs.path}/.git"; gitCommitId = lib.substring 0 7 (commitIdFromGitRepo gitRepo); @@ -25,14 +23,14 @@ in nixos.release = mkOption { readOnly = true; type = types.str; - default = fileContents releaseFile; + default = trivial.release; description = "The NixOS release (e.g. <literal>16.03</literal>)."; }; nixos.versionSuffix = mkOption { internal = true; type = types.str; - default = if pathExists suffixFile then fileContents suffixFile else "pre-git"; + default = trivial.versionSuffix; description = "The NixOS version suffix (e.g. <literal>1160.f2d4ee1</literal>)."; }; |