From 2f7435b5caa75da83305d470fdcbcfbb71a8c47c Mon Sep 17 00:00:00 2001 From: phaer Date: Wed, 9 Apr 2025 15:48:41 +0200 Subject: [PATCH] virtualisation/hyperv-image: use mkImageMediaOverride... ...for filesystem options. Before this change, users would typically encounter conflicting option definitions when trying to build an image for a generic nixos closure, i.e. `nixos-rebuild build-image --image-variant hyperv --flake .#my-host` --- nixos/modules/virtualisation/hyperv-image.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nixos/modules/virtualisation/hyperv-image.nix b/nixos/modules/virtualisation/hyperv-image.nix index 8f77d384a9ba..f292a60d71cd 100644 --- a/nixos/modules/virtualisation/hyperv-image.nix +++ b/nixos/modules/virtualisation/hyperv-image.nix @@ -73,15 +73,17 @@ in inherit config lib pkgs; }; - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - autoResize = true; - fsType = "ext4"; - }; + fileSystems = lib.mkImageMediaOverride { + "/" = { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + fsType = "ext4"; + }; - fileSystems."/boot" = { - device = "/dev/disk/by-label/ESP"; - fsType = "vfat"; + "/boot" = { + device = "/dev/disk/by-label/ESP"; + fsType = "vfat"; + }; }; boot.growPartition = true;