From 48956192c22b0bf34b39dbdf931988ba96dc3879 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 15 Jan 2019 10:46:45 +0100 Subject: [PATCH] add make-gce: make Google Compute Engine image --- README.md | 5 +++-- bin/make-gce | 5 +++++ lib/gce.nix | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 bin/make-gce create mode 100644 lib/gce.nix diff --git a/README.md b/README.md index 2dd0745..9295407 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,9 @@ it echoes the path to a iso image, which you then can flash onto an usb-stick or we currently have following generators: -format | script ---- | --- +format | script | description +--- | --- | --- +gce | bin/make-gce | Google Compute Image iso | bin/make-iso kexec | bin/make-kexec kexec-bundle | bin/make-kexec-bundle diff --git a/bin/make-gce b/bin/make-gce new file mode 100755 index 0000000..70ede03 --- /dev/null +++ b/bin/make-gce @@ -0,0 +1,5 @@ +#!/bin/sh +CONFIG=${1:-config.nix} +shift +out=$(nix-build --no-out-link '' -A config.system.build.googleComputeImage -I nixos-config=lib/gce.nix -I nixcfg=${CONFIG} "$@" ) +echo "$out"/*.tar.gz diff --git a/lib/gce.nix b/lib/gce.nix new file mode 100644 index 0000000..ea3bd28 --- /dev/null +++ b/lib/gce.nix @@ -0,0 +1,7 @@ +{ modulesPath, ... }: +{ + imports = [ + "${toString modulesPath}/virtualisation/google-compute-image.nix" + + ]; +}