2017-10-30 18:42:16 +01:00
|
|
|
|
/* Build a channel tarball. These contain, in addition to the nixpkgs
|
|
|
|
|
* expressions themselves, files that indicate the version of nixpkgs
|
2018-11-04 20:43:41 +01:00
|
|
|
|
* that they represent.
|
2017-10-30 18:42:16 +01:00
|
|
|
|
*/
|
2015-06-14 03:55:29 +02:00
|
|
|
|
{ pkgs, nixpkgs, version, versionSuffix }:
|
|
|
|
|
|
|
|
|
|
pkgs.releaseTools.makeSourceTarball {
|
|
|
|
|
name = "nixos-channel";
|
|
|
|
|
|
|
|
|
|
src = nixpkgs;
|
|
|
|
|
|
|
|
|
|
officialRelease = false; # FIXME: fix this in makeSourceTarball
|
|
|
|
|
inherit version versionSuffix;
|
|
|
|
|
|
2015-07-30 12:01:40 +02:00
|
|
|
|
buildInputs = [ pkgs.nix ];
|
2015-06-14 03:55:29 +02:00
|
|
|
|
|
|
|
|
|
distPhase = ''
|
|
|
|
|
rm -rf .git
|
|
|
|
|
echo -n $VERSION_SUFFIX > .version-suffix
|
|
|
|
|
echo -n ${nixpkgs.rev or nixpkgs.shortRev} > .git-revision
|
|
|
|
|
releaseName=nixos-$VERSION$VERSION_SUFFIX
|
|
|
|
|
mkdir -p $out/tarballs
|
2015-08-05 17:29:08 +02:00
|
|
|
|
cp -prd . ../$releaseName
|
2015-06-14 03:55:29 +02:00
|
|
|
|
chmod -R u+w ../$releaseName
|
2015-08-05 17:29:08 +02:00
|
|
|
|
ln -s . ../$releaseName/nixpkgs # hack to make ‘<nixpkgs>’ work
|
2023-02-04 00:02:47 +01:00
|
|
|
|
NIX_STATE_DIR=$TMPDIR nix-env -f ../$releaseName/default.nix -qaP --meta --show-trace --xml \* > /dev/null
|
2015-06-14 03:55:29 +02:00
|
|
|
|
cd ..
|
|
|
|
|
chmod -R u+w $releaseName
|
|
|
|
|
tar cfJ $out/tarballs/$releaseName.tar.xz $releaseName
|
|
|
|
|
'';
|
|
|
|
|
}
|