mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
virtualisation/openstack: 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 openstack-zfs --flake .#my-host`
This commit is contained in:
parent
6f83796aa5
commit
887f7d33e0
2 changed files with 24 additions and 18 deletions
|
@ -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" ];
|
||||
|
|
|
@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue