diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 9979b21..c03676e 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -9,6 +9,7 @@ let vmTools = pkgs.vmTools.override { rootModules = [ "9p" "9pnet_virtio" "virtio_pci" "virtio_blk" ] ++ nixosConfig.config.disko.extraRootModules; + customQemu = nixosConfig.config.disko.imageBuilderQemu; kernel = pkgs.aggregateModules (with nixosConfig.config.disko.imageBuilderKernelPackages; [ kernel ] ++ lib.optional (lib.elem "zfs" nixosConfig.config.disko.extraRootModules) zfs); diff --git a/module.nix b/module.nix index 321cc0e..d58f6ef 100644 --- a/module.nix +++ b/module.nix @@ -10,8 +10,16 @@ let in { options.disko = { - imageBuilderKernel = lib.mkOption { - type = lib.types.package; + imageBuilderQemu = lib.mkOption { + type = lib.types.nullOr lib.types.str; + description = '' + the qemu emulator string used when building disk images via make-disk-image.nix. + Useful when using binfmt on your build host, and wanting to build disk + images for a foreign architecture + ''; + default = null; + example = lib.literalExpression "''${pkgs.qemu_kvm}/bin/qemu-system-aarch64"; + }; imageBuilderPkgs = lib.mkOption { type = lib.types.attrs; description = ''