mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
virtualisation/google-compute: use system.build.image
This commit is contained in:
parent
a230d5228d
commit
41db5209c7
1 changed files with 8 additions and 4 deletions
|
@ -22,6 +22,7 @@ in
|
||||||
imports = [
|
imports = [
|
||||||
./google-compute-config.nix
|
./google-compute-config.nix
|
||||||
./disk-size-option.nix
|
./disk-size-option.nix
|
||||||
|
../image/file-options.nix
|
||||||
(lib.mkRenamedOptionModuleWith {
|
(lib.mkRenamedOptionModuleWith {
|
||||||
sinceRelease = 2411;
|
sinceRelease = 2411;
|
||||||
from = [
|
from = [
|
||||||
|
@ -72,8 +73,12 @@ in
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.nixos.tags = [ "google-compute" ];
|
||||||
|
image.extension = "raw.tar.gz";
|
||||||
|
system.build.image = config.system.build.googleComputeImage;
|
||||||
system.build.googleComputeImage = import ../../lib/make-disk-image.nix {
|
system.build.googleComputeImage = import ../../lib/make-disk-image.nix {
|
||||||
name = "google-compute-image";
|
name = "google-compute-image";
|
||||||
|
inherit (config.image) baseName;
|
||||||
postVM = ''
|
postVM = ''
|
||||||
PATH=$PATH:${
|
PATH=$PATH:${
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
@ -83,10 +88,9 @@ in
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
pushd $out
|
pushd $out
|
||||||
mv $diskImage disk.raw
|
tar -Sc $diskImage | gzip -${toString cfg.compressionLevel} > \
|
||||||
tar -Sc disk.raw | gzip -${toString cfg.compressionLevel} > \
|
${config.image.fileName}
|
||||||
nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz
|
rm $diskImage
|
||||||
rm $out/disk.raw
|
|
||||||
popd
|
popd
|
||||||
'';
|
'';
|
||||||
format = "raw";
|
format = "raw";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue