Skip to content

Commit

Permalink
virtualisation/oci-image: use system.build.image
Browse files Browse the repository at this point in the history
  • Loading branch information
phaer committed Nov 29, 2024
1 parent a0ce661 commit d8410d8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nixos/modules/virtualisation/oci-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ let
cfg = config.oci;
in
{
imports = [ ./oci-common.nix ];
imports = [
./oci-common.nix
../image/file-options.nix
];

config = {
# Use a priority just below mkOptionDefault (1500) instead of lib.mkDefault
# to avoid breaking existing configs using that.
virtualisation.diskSize = lib.mkOverride 1490 (8 * 1024);
virtualisation.diskSizeAutoSupported = false;

system.nixos.tags = [ "oci" ];
image.extension = "qcow2";
system.build.image = config.system.build.OCIImage;
system.build.OCIImage = import ../../lib/make-disk-image.nix {
inherit config lib pkgs;
inherit (config.virtualisation) diskSize;
name = "oci-image";
baseName = config.image.baseName;
configFile = ./oci-config-user.nix;
format = "qcow2";
partitionTableType = if cfg.efi then "efi" else "legacy";
Expand Down

0 comments on commit d8410d8

Please sign in to comment.