From 53df1e4ece80dffa673d338a19c541fb1b81cde9 Mon Sep 17 00:00:00 2001 From: phaer Date: Mon, 2 Sep 2024 10:55:54 +0200 Subject: [PATCH] virtualisation/qemu-vm: disallow nullable diskSize Because `virtualisation.diskSize = null` does result in a broken vm runner, see https://github.com/NixOS/nixpkgs/issues/292901. diskSize was declared to be nullable when it first got types in a tree-wide commit: https://github.com/NixOS/nixpkgs/commit/30f0faac22b6d8a6c6b308a0aa44ee672f2827eb But it seemingly never actually supported it, as "${cfg.diskSize}M" is passed to qemu-img create, which doesn't allow an empty size parameter. closes: https://github.com/NixOS/nixpkgs/issues/292901 --- nixos/modules/virtualisation/qemu-vm.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index a1aed8c4e917..153dc877352a 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -329,7 +329,7 @@ in virtualisation.diskSize = mkOption { - type = types.nullOr types.ints.positive; + type = types.ints.positive; default = 1024; description = '' The disk size in megabytes of the virtual machine.