diff --git a/mirror-nixos.sh b/mirror-nixos.sh index 66799c5..e8f559d 100755 --- a/mirror-nixos.sh +++ b/mirror-nixos.sh @@ -34,8 +34,8 @@ else $wget --directory=$tmpDir $url/nixos.iso_graphical.x86_64-linux/download perl -w ./mirror-channel.pl "$url/eval/channel" "$tmpDir" \ - /data/releases/binary-cache http://nixos.org/binary-cache \ - /data/releases/patches/all-patches "$url/nixos.channel/download/1" + nix-cache http://cache.nixos.org \ + /data/releases/patches/all-patches "$url/nixos.channel/download/1" # Generate the programs.sqlite database and put it in nixexprs.tar.xz. mkdir $tmpDir/unpack @@ -53,7 +53,6 @@ echo "Redirect /channels/$channelName http://nixos.org/releases/nixos/$release" echo "Redirect /releases/nixos/channels/$channelName http://nixos.org/releases/nixos/$release" >> $htaccess.tmp ln -sfn $releaseDir $channelsDir/$channelName # dummy symlink mv $htaccess.tmp $htaccess -flock -x $channelsDir/.htaccess.lock -c "cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess" # Generate a .htaccess with some symbolic redirects to the latest ISOs. htaccess=$releasesDir/.htaccess @@ -69,3 +68,9 @@ fn=$(cd $releaseDir && echo nixos-graphical-*-x86_64-linux.iso) echo "Redirect /releases/nixos/latest-iso-graphical-x86_64-linux http://nixos.org/releases/nixos/$release/$fn" >> $htaccess.tmp mv $htaccess.tmp $htaccess + +# Copy over to nixos.org +cd /data/releases +rsync -avR nixos hydra-mirror@nixos.org:/data/releases --exclude nixos/.htaccess --delete +rsync -avR channels/.htaccess-nixos channels/nixos-unstable hydra-mirror@nixos.org:/data/releases +ssh nixos.org "flock -x $channelsDir/.htaccess.lock -c \"cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess\"" diff --git a/mirror-nixpkgs.sh b/mirror-nixpkgs.sh index 09599e1..06070f3 100755 --- a/mirror-nixpkgs.sh +++ b/mirror-nixpkgs.sh @@ -28,8 +28,8 @@ else echo $url > $tmpDir/src-url perl -w ./mirror-channel.pl "$url/eval/channel" "$tmpDir" \ - /data/releases/binary-cache http://nixos.org/binary-cache \ - /data/releases/patches/all-patches "$url/tarball/download/4" + nix-cache http://cache.nixos.org \ + /data/releases/patches/all-patches "$url/tarball/download/4" mv $tmpDir $releaseDir fi @@ -39,4 +39,9 @@ echo "Redirect /channels/$channelName http://nixos.org/releases/nixpkgs/$release echo "Redirect /releases/nixpkgs/channels/$channelName http://nixos.org/releases/nixpkgs/$release" >> $htaccess.tmp ln -sfn $releaseDir $channelsDir/$channelName # dummy symlink mv $htaccess.tmp $htaccess -flock -x $channelsDir/.htaccess.lock -c "cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess" + +# Copy over to nixos.org +cd /data/releases +rsync -avR nixpkgs hydra-mirror@nixos.org:/data/releases --exclude nixpkgs/.htaccess --delete +rsync -avR channels/.htaccess-nixpkgs channels/nixpkgs-unstable hydra-mirror@nixos.org:/data/releases +ssh nixos.org "flock -x $channelsDir/.htaccess.lock -c \"cat $channelsDir/.htaccess-nix* > $channelsDir/.htaccess\""