add make-gce: make Google Compute Engine image

This commit is contained in:
zimbatm 2019-01-15 10:46:45 +01:00
parent 6bf7e8c291
commit 48956192c2
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
3 changed files with 15 additions and 2 deletions

View File

@ -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

5
bin/make-gce Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
CONFIG=${1:-config.nix}
shift
out=$(nix-build --no-out-link '<nixpkgs/nixos>' -A config.system.build.googleComputeImage -I nixos-config=lib/gce.nix -I nixcfg=${CONFIG} "$@" )
echo "$out"/*.tar.gz

7
lib/gce.nix Normal file
View File

@ -0,0 +1,7 @@
{ modulesPath, ... }:
{
imports = [
"${toString modulesPath}/virtualisation/google-compute-image.nix"
<nixcfg>
];
}