about summary refs log tree commit diff
path: root/nixos/modules/virtualisation/google-compute-image.nix
diff options
context:
space:
mode:
authorRob Vermaas <rob.vermaas@gmail.com>2014-03-21 14:55:42 +0100
committerRob Vermaas <rob.vermaas@gmail.com>2014-03-21 14:56:00 +0100
commitaf6c571a7e6784526bd97587bf900d2546acf6e9 (patch)
tree71160437010e76cb124bf81bcb83f6278a7e3150 /nixos/modules/virtualisation/google-compute-image.nix
parentf3f6f04c7d64030fdaaf97cdd381c23b3faeae0b (diff)
downloadnixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar.gz
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar.bz2
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar.lz
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar.xz
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.tar.zst
nixlib-af6c571a7e6784526bd97587bf900d2546acf6e9.zip
Increase size of GCE image. Use disk.raw as name inside tar.gz, as this is compulsory.
Diffstat (limited to 'nixos/modules/virtualisation/google-compute-image.nix')
-rw-r--r--nixos/modules/virtualisation/google-compute-image.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix
index 634932ff0077..1439c26b071c 100644
--- a/nixos/modules/virtualisation/google-compute-image.nix
+++ b/nixos/modules/virtualisation/google-compute-image.nix
@@ -1,7 +1,9 @@
 { config, pkgs, ... }:
 
 with pkgs.lib;
-
+let
+  diskSize = "200G";
+in
 {
   imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ];
 
@@ -12,7 +14,7 @@ with pkgs.lib;
             ''
               mkdir $out
               diskImage=$out/$diskImageBase
-              truncate $diskImage --size 10G
+              truncate $diskImage --size ${diskSize}
               mv closure xchg/
             '';
 
@@ -20,8 +22,9 @@ with pkgs.lib;
             ''
               PATH=$PATH:${pkgs.gnutar}/bin:${pkgs.gzip}/bin
               pushd $out
-              tar -Szcf $diskImageBase.tar.gz $diskImageBase
-              rm $out/$diskImageBase
+              mv $diskImageBase disk.raw
+              tar -Szcf $diskImageBase.tar.gz disk.raw
+              rm $out/disk.raw
               popd
             '';
           diskImageBase = "nixos-${config.system.nixosVersion}-${pkgs.stdenv.system}.raw";
@@ -32,7 +35,7 @@ with pkgs.lib;
         ''
           # Create partition table
           ${pkgs.parted}/sbin/parted /dev/vda mklabel msdos
-          ${pkgs.parted}/sbin/parted /dev/vda mkpart primary ext4 1 10G
+          ${pkgs.parted}/sbin/parted /dev/vda mkpart primary ext4 1 ${diskSize}
           ${pkgs.parted}/sbin/parted /dev/vda print
           . /sys/class/block/vda1/uevent
           mknod /dev/vda1 b $MAJOR $MINOR