Set nixos diskSize option only if specialArgs.diskSize exists

This commit is contained in:
Proesmans Bert 2024-03-03 15:43:35 +01:00 committed by GitHub
parent 2c9562e762
commit 2ba4060480
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,9 +10,7 @@ in {
"${toString modulesPath}/virtualisation/qemu-vm.nix"
];
virtualisation.diskSize =
if diskSize == "auto" then null
else lib.strings.toIntBase10 diskSize;
virtualisation.diskSize = lib.mkIf (diskSize != "auto") (lib.strings.toIntBase10 diskSize);
formatAttr = "vm";
}