mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
Factor the NixOS channel building code out into its own file, so I can use it elsewhere
This commit is contained in:
parent
ebde5fd9d4
commit
10e75453b2
31
nixos/lib/make-channel.nix
Normal file
31
nixos/lib/make-channel.nix
Normal file
@ -0,0 +1,31 @@
|
||||
{ pkgs, nixpkgs, version, versionSuffix }:
|
||||
|
||||
pkgs.releaseTools.makeSourceTarball {
|
||||
name = "nixos-channel";
|
||||
|
||||
src = nixpkgs;
|
||||
|
||||
officialRelease = false; # FIXME: fix this in makeSourceTarball
|
||||
inherit version versionSuffix;
|
||||
|
||||
buildInputs = [ pkgs.nixUnstable ];
|
||||
|
||||
expr = builtins.readFile ./channel-expr.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
|
||||
mkdir ../$releaseName
|
||||
cp -prd . ../$releaseName/nixpkgs
|
||||
chmod -R u+w ../$releaseName
|
||||
ln -s nixpkgs/nixos ../$releaseName/nixos
|
||||
echo "$expr" > ../$releaseName/default.nix
|
||||
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
|
||||
'';
|
||||
}
|
@ -93,37 +93,7 @@ let
|
||||
|
||||
in rec {
|
||||
|
||||
channel =
|
||||
pkgs.releaseTools.makeSourceTarball {
|
||||
name = "nixos-channel";
|
||||
|
||||
src = nixpkgs;
|
||||
|
||||
officialRelease = false; # FIXME: fix this in makeSourceTarball
|
||||
inherit version versionSuffix;
|
||||
|
||||
buildInputs = [ pkgs.nixUnstable ];
|
||||
|
||||
expr = builtins.readFile lib/channel-expr.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
|
||||
mkdir ../$releaseName
|
||||
cp -prd . ../$releaseName/nixpkgs
|
||||
chmod -R u+w ../$releaseName
|
||||
ln -s nixpkgs/nixos ../$releaseName/nixos
|
||||
echo "$expr" > ../$releaseName/default.nix
|
||||
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
|
||||
''; # */
|
||||
};
|
||||
|
||||
channel = import lib/make-channel.nix { inherit pkgs nixpkgs version versionSuffix; };
|
||||
|
||||
manual = buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manual);
|
||||
manualPDF = (buildFromConfig ({ pkgs, ... }: { }) (config: config.system.build.manual.manualPDF)).x86_64-linux;
|
||||
|
Loading…
Reference in New Issue
Block a user