Combine ccpkgs and nixpkgs versions together in suffix
Want a unique name for the output product of each combination for the channel-update code.
This commit is contained in:
51
release.nix
51
release.nix
@@ -1,10 +1,10 @@
|
|||||||
{ nixpkgs # Checked out nixpkgs git repe
|
{ ccpkgs # Checked out ccpkgs git repo
|
||||||
? { outPath = ./upstream;
|
|
||||||
revCount = 56789;
|
|
||||||
shortRev = "gfedcba";
|
|
||||||
}
|
|
||||||
, ccpkgs # Checked out ccpkgs git repo
|
|
||||||
? { outPath = ./.;
|
? { outPath = ./.;
|
||||||
|
revCount = 1234;
|
||||||
|
shortRev = "gabcdef";
|
||||||
|
}
|
||||||
|
, nixpkgs # Checked out nixpkgs git repe
|
||||||
|
? { outPath = ./upstream;
|
||||||
revCount = 56789;
|
revCount = 56789;
|
||||||
shortRev = "gfedcba";
|
shortRev = "gfedcba";
|
||||||
}
|
}
|
||||||
@@ -15,11 +15,10 @@
|
|||||||
# Free up the nixpkgs and ccpkgs name for binding to final product.
|
# Free up the nixpkgs and ccpkgs name for binding to final product.
|
||||||
#
|
#
|
||||||
let
|
let
|
||||||
# nixpkgsGit - git checkout of nixpkgs
|
# *Git - git checkout
|
||||||
# ccpkgsGit - git checkout of ccpkgs
|
|
||||||
#
|
#
|
||||||
nixpkgsGit = nixpkgs;
|
nixpkgsGit = nixpkgs;
|
||||||
ccpkgsGit = ccpkgs;
|
ccpkgsGit = ccpkgs;
|
||||||
|
|
||||||
# Tarball hydra release product for the ccpkgs channel.
|
# Tarball hydra release product for the ccpkgs channel.
|
||||||
#
|
#
|
||||||
@@ -34,14 +33,30 @@ in let
|
|||||||
#
|
#
|
||||||
pkgs = import ccpkgsGit { upstream = nixpkgsGit; };
|
pkgs = import ccpkgsGit { upstream = nixpkgsGit; };
|
||||||
|
|
||||||
# version - Version number of nixpkgs (and hence ccpkgs too)
|
# version - Version number (e.g., "17.09")
|
||||||
# versionSuffix - Version suffix based on git commnit
|
# version*Suffix - Version suffix (e.g., "5678.gfedcba")
|
||||||
#
|
#
|
||||||
# Code lifted from nixos/release.nix.
|
# Code lifted from nixos/release.nix.
|
||||||
#
|
#
|
||||||
version = pkgs.lib.fileContents ./.version;
|
version =
|
||||||
versionSuffix =
|
let
|
||||||
(if stableBranch then "." else "beta") + "${toString (nixpkgsGit.revCount - 114283)}.${nixpkgsGit.shortRev}";
|
versionNixpkgs = pkgs.lib.fileContents (nixpkgsGit + /.version);
|
||||||
|
versionCcpkgs = pkgs.lib.fileContents ./.version;
|
||||||
|
in
|
||||||
|
assert (versionNixpkgs == versionCcpkgs); versionCcpkgs;
|
||||||
|
|
||||||
|
versionSeparator = if stableBranch then "." else "beta";
|
||||||
|
|
||||||
|
mkVersion = base: git: rec {
|
||||||
|
count = toString (git.revCount - base);
|
||||||
|
commit = git.shortRev;
|
||||||
|
suffix = "${versionSeparator}${count}.${commit}";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgsVersion = mkVersion 114283 nixpkgsGit;
|
||||||
|
ccpkgsVersion = mkVersion 0 ccpkgsGit;
|
||||||
|
|
||||||
|
versionSuffix = "${versionSeparator}${ccpkgsVersion.count}.${nixpkgsVersion.count}.${ccpkgsVersion.commit}.${nixpkgsVersion.commit}";
|
||||||
|
|
||||||
# nixpkgs - The store path containing the unpacked nixpkgs channel.
|
# nixpkgs - The store path containing the unpacked nixpkgs channel.
|
||||||
#
|
#
|
||||||
@@ -50,18 +65,14 @@ in let
|
|||||||
#
|
#
|
||||||
nixpkgs =
|
nixpkgs =
|
||||||
let
|
let
|
||||||
# version - Version of checked out nixpkgs
|
|
||||||
#
|
|
||||||
version = pkgs.lib.fileContents (nixpkgsGit + /.version);
|
|
||||||
|
|
||||||
# channel - Store path containing the channel release tarballs.
|
# channel - Store path containing the channel release tarballs.
|
||||||
#
|
#
|
||||||
# The nixos.channel attribute from nixos/release.nix builds the nixpkgs channel tarballs.
|
# The nixos.channel attribute from nixos/release.nix builds the nixpkgs channel tarballs.
|
||||||
#
|
#
|
||||||
channel =
|
channel =
|
||||||
( import (nixpkgsGit + /nixos/release.nix) {
|
( import (nixpkgsGit + /nixos/release.nix) {
|
||||||
nixpkgs = nixpkgsGit;
|
|
||||||
inherit stableBranch supportedSystems;
|
inherit stableBranch supportedSystems;
|
||||||
|
nixpkgs = nixpkgsGit;
|
||||||
} ).channel;
|
} ).channel;
|
||||||
|
|
||||||
# nixpkgs - The store path containing the unpacked nixpkgs channel.
|
# nixpkgs - The store path containing the unpacked nixpkgs channel.
|
||||||
@@ -72,7 +83,7 @@ in let
|
|||||||
( import <nix/unpack-channel.nix> rec {
|
( import <nix/unpack-channel.nix> rec {
|
||||||
name = "nixos";
|
name = "nixos";
|
||||||
channelName = "${name}-${version}";
|
channelName = "${name}-${version}";
|
||||||
src = channel + /tarballs + "/${name}-${version}${versionSuffix}.tar.xz";
|
src = channel + /tarballs + "/${name}-${version}${nixpkgsVersion.suffix}.tar.xz";
|
||||||
binaryCacheURL = https://cache.nixos.org;
|
binaryCacheURL = https://cache.nixos.org;
|
||||||
} );
|
} );
|
||||||
in
|
in
|
||||||
|
|||||||
Reference in New Issue
Block a user