From 61ba0446582326e339c2dfbf2b96cc37b16db6f2 Mon Sep 17 00:00:00 2001 From: phaer Date: Wed, 9 Apr 2025 12:52:50 +0200 Subject: [PATCH] virtualisation/oci-common: 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 common --flake .#my-host` --- nixos/modules/virtualisation/oci-common.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nixos/modules/virtualisation/oci-common.nix b/nixos/modules/virtualisation/oci-common.nix index d92cda7de437..73b68c57f3e2 100644 --- a/nixos/modules/virtualisation/oci-common.nix +++ b/nixos/modules/virtualisation/oci-common.nix @@ -30,15 +30,17 @@ in boot.growPartition = true; - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - autoResize = true; - }; + fileSystems = lib.mkImageMediaOverride { + "/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + autoResize = true; + }; - fileSystems."/boot" = lib.mkIf cfg.efi { - device = "/dev/disk/by-label/ESP"; - fsType = "vfat"; + "/boot" = lib.mkIf cfg.efi { + device = "/dev/disk/by-label/ESP"; + fsType = "vfat"; + }; }; boot.loader.efi.canTouchEfiVariables = false;