diff options
author | embr <git@liclac.eu> | 2021-07-13 16:53:09 +0200 |
---|---|---|
committer | embr <git@liclac.eu> | 2021-07-13 16:53:09 +0200 |
commit | 91646d62b9cd513820a4b82371da341fa9ec1218 (patch) | |
tree | 81d9641d9cb8a8629e3a5094c588fb6f3795caf9 /nixos/modules/virtualisation | |
parent | 9e18ae4302981e4a3f37ce7c1e677a72b2305561 (diff) | |
download | nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar.gz nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar.bz2 nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar.lz nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar.xz nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.tar.zst nixpkgs-91646d62b9cd513820a4b82371da341fa9ec1218.zip |
google-compute-image: Make GZIP compression level configurable
Change-Id: I1bde130f0a951fa40b1a16bad09497c796bca473
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/google-compute-image.nix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 79c3921669e..0c72696f802 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -36,6 +36,14 @@ in `<nixpkgs/nixos/modules/virtualisation/google-compute-image.nix>`. ''; }; + + virtualisation.googleComputeImage.compressionLevel = mkOption { + type = types.int; + default = 6; + description = '' + GZIP compression level of the resulting disk image (1-9). + ''; + }; }; #### implementation @@ -47,7 +55,8 @@ in PATH=$PATH:${with pkgs; lib.makeBinPath [ gnutar gzip ]} pushd $out mv $diskImage disk.raw - tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz disk.raw + tar -Sc disk.raw | gzip -${toString cfg.compressionLevel} > \ + nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz rm $out/disk.raw popd ''; |