2cd7c1f198
This is primarily to ensure that -I nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz and -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz and -I nixpkgs=https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz behave consistently. It also allows installing packages via "nix-env -iA nixos.<pkg>" rather than "nixos.pkgs.<pkg>". It would be even better to allow "nixpkgs.<pkg>", but that requires a change to nix-channel. Fixes #7659.
28 lines
813 B
Nix
28 lines
813 B
Nix
{ pkgs, nixpkgs, version, versionSuffix }:
|
||
|
||
pkgs.releaseTools.makeSourceTarball {
|
||
name = "nixos-channel";
|
||
|
||
src = nixpkgs;
|
||
|
||
officialRelease = false; # FIXME: fix this in makeSourceTarball
|
||
inherit version versionSuffix;
|
||
|
||
buildInputs = [ pkgs.nix ];
|
||
|
||
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
|
||
cp -prd . ../$releaseName
|
||
chmod -R u+w ../$releaseName
|
||
ln -s . ../$releaseName/nixpkgs # hack to make ‘<nixpkgs>’ work
|
||
NIX_STATE_DIR=$TMPDIR nix-env -f ../$releaseName/default.nix -qaP --meta --xml \* > /dev/null
|
||
cd ..
|
||
chmod -R u+w $releaseName
|
||
tar cfJ $out/tarballs/$releaseName.tar.xz $releaseName
|
||
'';
|
||
}
|