3
0
Fork 0
forked from mirrors/nixpkgs

Adapt S3 ami creation script to new nixpkgs structure

This commit is contained in:
Rob Vermaas 2013-11-08 11:40:58 +00:00
parent e9921632ef
commit 001550d5fe

View file

@ -1,9 +1,8 @@
#! /bin/sh -e
nixos=$(nix-instantiate --find-file nixos)
export NIXOS_CONFIG=$(dirname $(readlink -f $0))/amazon-base-config.nix
version=$(nix-instantiate --eval-only '<nixos>' -A config.system.nixosVersion | sed s/'"'//g)
version=$(nix-instantiate --eval-only '<nixpkgs/nixos>' -A config.system.nixosVersion | sed s/'"'//g)
echo "NixOS version is $version"
buildAndUploadFor() {
@ -11,13 +10,13 @@ buildAndUploadFor() {
arch="$2"
echo "building $system image..."
nix-build '<nixos>' \
nix-build '<nixpkgs/nixos>' \
-A config.system.build.amazonImage --argstr system "$system" -o ec2-ami
ec2-bundle-image -i ./ec2-ami/nixos.img --user "$AWS_ACCOUNT" --arch "$arch" \
-c "$EC2_CERT" -k "$EC2_PRIVATE_KEY"
for region in eu-west-1 us-east-1 us-west-1 us-west-2; do
for region in eu-west-1; do
echo "uploading $system image for $region..."
name=nixos-$version-$arch-s3