Revert "Use mkImageMediaOverride for filesystem attributes of various images"

This commit is contained in:
illustris 2025-04-29 08:41:26 +05:30 committed by GitHub
parent 81229d1108
commit 5803bdb9fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 63 additions and 81 deletions

View file

@ -185,7 +185,7 @@ in
config = {
hardware.enableAllHardware = true;
fileSystems = lib.mkImageMediaOverride {
fileSystems = {
"/boot/firmware" = {
device = "/dev/disk/by-label/${config.sdImage.firmwarePartitionName}";
fsType = "vfat";

View file

@ -113,7 +113,7 @@ in
'';
};
fileSystems = lib.mkImageMediaOverride {
fileSystems = {
"/" = {
device = "/dev/disk/by-label/${cfg.label}";
inherit (cfg) label;

View file

@ -39,7 +39,7 @@ with lib;
in
mkMerge [
{
fileSystems."/" = lib.mkImageMediaOverride {
fileSystems."/" = lib.mkDefault {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";

View file

@ -37,7 +37,7 @@ in
boot.loader.systemd-boot.enable = lib.mkDefault cfg.efiSupport;
boot.growPartition = lib.mkDefault true;
fileSystems = lib.mkImageMediaOverride {
fileSystems = {
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;

View file

@ -21,7 +21,7 @@ in
../profiles/qemu-guest.nix
];
fileSystems."/" = lib.mkImageMediaOverride {
fileSystems."/" = {
fsType = "ext4";
device = "/dev/disk/by-label/nixos";
autoResize = true;

View file

@ -73,17 +73,15 @@ in
inherit config lib pkgs;
};
fileSystems = lib.mkImageMediaOverride {
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
boot.growPartition = true;

View file

@ -12,7 +12,7 @@
];
config = {
fileSystems."/" = lib.mkImageMediaOverride {
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;

View file

@ -1,8 +1,10 @@
{
config,
lib,
pkgs,
...
}:
with lib;
{
imports = [ ../profiles/qemu-guest.nix ];
@ -10,7 +12,7 @@
enable = true;
settings.PermitRootLogin = "prohibit-password";
settings.PasswordAuthentication = lib.mkDefault false;
settings.PasswordAuthentication = mkDefault false;
};
networking = {
@ -32,13 +34,13 @@
sysstat
];
fileSystems."/" = lib.mkImageMediaOverride {
fileSystems."/" = {
fsType = "ext4";
device = "/dev/sda";
autoResize = true;
};
swapDevices = lib.mkDefault [ { device = "/dev/sdb"; } ];
swapDevices = mkDefault [ { device = "/dev/sdb"; } ];
# Enable LISH and Linode Booting w/ GRUB
boot = {

View file

@ -30,17 +30,15 @@ in
boot.growPartition = true;
fileSystems = lib.mkImageMediaOverride {
"/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
"/boot" = lib.mkIf cfg.efi {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
fileSystems."/boot" = lib.mkIf cfg.efi {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
boot.loader.efi.canTouchEfiVariables = false;

View file

@ -33,22 +33,18 @@ in
];
config = {
fileSystems."/" = mkIf (!cfg.zfs.enable) (
lib.mkImageMediaOverride {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
}
);
fileSystems."/" = mkIf (!cfg.zfs.enable) {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
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";
}
);
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";
};
boot.growPartition = true;
boot.kernelParams = [ "console=tty1" ];

View file

@ -70,14 +70,12 @@ in
_: value: ((value.mount or null) != null)
) config.openstack.zfs.datasets;
in
lib.mkImageMediaOverride (
lib.mapAttrs' (
dataset: opts:
lib.nameValuePair opts.mount {
device = dataset;
fsType = "zfs";
}
) mountable
);
lib.mapAttrs' (
dataset: opts:
lib.nameValuePair opts.mount {
device = dataset;
fsType = "zfs";
}
) mountable;
};
}

View file

@ -306,13 +306,7 @@ with lib;
''
${vma}/bin/vma create "${config.image.baseName}.vma" \
-c ${
cfgFile "qemu-server.conf" (
(builtins.removeAttrs cfg.qemuConf [ "diskSize" ])
// {
inherit (config.virtualisation) diskSize;
}
// cfg.qemuExtraConf
)
cfgFile "qemu-server.conf" (cfg.qemuConf // cfg.qemuExtraConf)
}/qemu-server.conf drive-virtio0=$diskImage
rm $diskImage
${pkgs.zstd}/bin/zstd "${config.image.baseName}.vma"
@ -352,16 +346,14 @@ with lib;
];
};
fileSystems = lib.mkImageMediaOverride {
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
"/boot" = lib.mkIf hasBootPartition {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
fileSystems."/boot" = lib.mkIf hasBootPartition {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
networking = mkIf cfg.cloudInit.enable {

View file

@ -275,7 +275,7 @@ in
};
fileSystems =
lib.mkImageMediaOverride {
{
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;

View file

@ -83,17 +83,15 @@ in
inherit config lib pkgs;
};
fileSystems = lib.mkImageMediaOverride {
"/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
autoResize = true;
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
fileSystems."/boot" = {
device = "/dev/disk/by-label/ESP";
fsType = "vfat";
};
boot.growPartition = true;