virtualisation/linode-image: Use system.build.image
This commit is contained in:
parent
40142caad0
commit
47c83cb438
@ -20,6 +20,7 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
./linode-config.nix
|
./linode-config.nix
|
||||||
./disk-size-option.nix
|
./disk-size-option.nix
|
||||||
|
../image/file-options.nix
|
||||||
(lib.mkRenamedOptionModuleWith {
|
(lib.mkRenamedOptionModuleWith {
|
||||||
sinceRelease = 2411;
|
sinceRelease = 2411;
|
||||||
from = [
|
from = [
|
||||||
@ -57,13 +58,17 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
system.nixos.tags = [ "linode" ];
|
||||||
|
image.extension = "img.gz";
|
||||||
|
system.build.image = config.system.build.linodeImage;
|
||||||
system.build.linodeImage = import ../../lib/make-disk-image.nix {
|
system.build.linodeImage = import ../../lib/make-disk-image.nix {
|
||||||
name = "linode-image";
|
name = "linode-image";
|
||||||
|
baseName = config.image.baseName;
|
||||||
# NOTE: Linode specifically requires images to be `gzip`-ed prior to upload
|
# NOTE: Linode specifically requires images to be `gzip`-ed prior to upload
|
||||||
# See: https://www.linode.com/docs/products/tools/images/guides/upload-an-image/#requirements-and-considerations
|
# See: https://www.linode.com/docs/products/tools/images/guides/upload-an-image/#requirements-and-considerations
|
||||||
postVM = ''
|
postVM = ''
|
||||||
${pkgs.gzip}/bin/gzip -${toString cfg.compressionLevel} -c -- $diskImage > \
|
${pkgs.gzip}/bin/gzip -${toString cfg.compressionLevel} -c -- $diskImage > \
|
||||||
$out/nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.img.gz
|
$out/${config.image.fileName}
|
||||||
rm $diskImage
|
rm $diskImage
|
||||||
'';
|
'';
|
||||||
format = "raw";
|
format = "raw";
|
||||||
|
Loading…
Reference in New Issue
Block a user