diff --git a/nixos/modules/virtualisation/openstack-config.nix b/nixos/modules/virtualisation/openstack-config.nix index caa3cbba6a6b..34031c303039 100644 --- a/nixos/modules/virtualisation/openstack-config.nix +++ b/nixos/modules/virtualisation/openstack-config.nix @@ -33,18 +33,22 @@ in ]; config = { - fileSystems."/" = mkIf (!cfg.zfs.enable) { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - autoResize = true; - }; + fileSystems."/" = mkIf (!cfg.zfs.enable) ( + lib.mkImageMediaOverride { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + autoResize = true; + } + ); - fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) { - # The ZFS image uses a partition labeled ESP whether or not we're - # booting with EFI. - device = "/dev/disk/by-label/ESP"; - fsType = "vfat"; - }; + fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) ( + lib.mkImageMediaOverride { + # The ZFS image uses a partition labeled ESP whether or not we're + # booting with EFI. + device = "/dev/disk/by-label/ESP"; + fsType = "vfat"; + } + ); boot.growPartition = true; boot.kernelParams = [ "console=tty1" ]; diff --git a/nixos/modules/virtualisation/openstack-options.nix b/nixos/modules/virtualisation/openstack-options.nix index 9d1b1efd676d..751e1612e833 100644 --- a/nixos/modules/virtualisation/openstack-options.nix +++ b/nixos/modules/virtualisation/openstack-options.nix @@ -70,12 +70,14 @@ in _: value: ((value.mount or null) != null) ) config.openstack.zfs.datasets; in - lib.mapAttrs' ( - dataset: opts: - lib.nameValuePair opts.mount { - device = dataset; - fsType = "zfs"; - } - ) mountable; + lib.mkImageMediaOverride ( + lib.mapAttrs' ( + dataset: opts: + lib.nameValuePair opts.mount { + device = dataset; + fsType = "zfs"; + } + ) mountable + ); }; }