summary refs log tree commit diff
path: root/nixos/maintainers/scripts/gce/create-gce.sh
blob: 8bf36f33c7db4068e41013a4ea40ff2eb7025101 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#! /bin/sh -e

export NIX_PATH=nixpkgs=../../../..
export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/google-compute-image.nix
export TIMESTAMP=$(date +%Y%m%d%H%M)

nix-build '<nixpkgs/nixos>' \
   -A config.system.build.googleComputeImage --argstr system x86_64-linux -o gce --option extra-binary-caches http://hydra.nixos.org -j 10

img=$(echo gce/*.tar.gz)
if ! gsutil ls gs://nixos/$(basename $img); then
  gsutil cp $img gs://nixos/$(basename $img)
fi
gcutil addimage $(basename $img .raw.tar.gz | sed 's|\.|-|' | sed 's|_|-|') gs://nixos/$(basename $img)