Merge pull request #7 from zimbatm/make-gce

add make-gce: make Google Compute Engine image
This commit is contained in:
Lassulus 2019-01-15 19:18:50 +01:00 committed by GitHub
commit 400b73364a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>
];
}