mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
Revert "Use mkImageMediaOverride for filesystem attributes of various images"
This commit is contained in:
parent
81229d1108
commit
5803bdb9fc
14 changed files with 63 additions and 81 deletions
|
@ -185,7 +185,7 @@ in
|
||||||
config = {
|
config = {
|
||||||
hardware.enableAllHardware = true;
|
hardware.enableAllHardware = true;
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems = {
|
||||||
"/boot/firmware" = {
|
"/boot/firmware" = {
|
||||||
device = "/dev/disk/by-label/${config.sdImage.firmwarePartitionName}";
|
device = "/dev/disk/by-label/${config.sdImage.firmwarePartitionName}";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
|
|
|
@ -113,7 +113,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-label/${cfg.label}";
|
device = "/dev/disk/by-label/${cfg.label}";
|
||||||
inherit (cfg) label;
|
inherit (cfg) label;
|
||||||
|
|
|
@ -39,7 +39,7 @@ with lib;
|
||||||
in
|
in
|
||||||
mkMerge [
|
mkMerge [
|
||||||
{
|
{
|
||||||
fileSystems."/" = lib.mkImageMediaOverride {
|
fileSystems."/" = lib.mkDefault {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
|
|
@ -37,7 +37,7 @@ in
|
||||||
boot.loader.systemd-boot.enable = lib.mkDefault cfg.efiSupport;
|
boot.loader.systemd-boot.enable = lib.mkDefault cfg.efiSupport;
|
||||||
boot.growPartition = lib.mkDefault true;
|
boot.growPartition = lib.mkDefault true;
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems = {
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
|
|
|
@ -21,7 +21,7 @@ in
|
||||||
../profiles/qemu-guest.nix
|
../profiles/qemu-guest.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
fileSystems."/" = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
|
|
|
@ -73,17 +73,15 @@ in
|
||||||
inherit config lib pkgs;
|
inherit config lib pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
"/" = {
|
device = "/dev/disk/by-label/nixos";
|
||||||
device = "/dev/disk/by-label/nixos";
|
autoResize = true;
|
||||||
autoResize = true;
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-label/ESP";
|
device = "/dev/disk/by-label/ESP";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.growPartition = true;
|
boot.growPartition = true;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
fileSystems."/" = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
with lib;
|
||||||
{
|
{
|
||||||
imports = [ ../profiles/qemu-guest.nix ];
|
imports = [ ../profiles/qemu-guest.nix ];
|
||||||
|
|
||||||
|
@ -10,7 +12,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings.PermitRootLogin = "prohibit-password";
|
settings.PermitRootLogin = "prohibit-password";
|
||||||
settings.PasswordAuthentication = lib.mkDefault false;
|
settings.PasswordAuthentication = mkDefault false;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
@ -32,13 +34,13 @@
|
||||||
sysstat
|
sysstat
|
||||||
];
|
];
|
||||||
|
|
||||||
fileSystems."/" = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
device = "/dev/sda";
|
device = "/dev/sda";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices = lib.mkDefault [ { device = "/dev/sdb"; } ];
|
swapDevices = mkDefault [ { device = "/dev/sdb"; } ];
|
||||||
|
|
||||||
# Enable LISH and Linode Booting w/ GRUB
|
# Enable LISH and Linode Booting w/ GRUB
|
||||||
boot = {
|
boot = {
|
||||||
|
|
|
@ -30,17 +30,15 @@ in
|
||||||
|
|
||||||
boot.growPartition = true;
|
boot.growPartition = true;
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
"/" = {
|
device = "/dev/disk/by-label/nixos";
|
||||||
device = "/dev/disk/by-label/nixos";
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
autoResize = true;
|
||||||
autoResize = true;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"/boot" = lib.mkIf cfg.efi {
|
fileSystems."/boot" = lib.mkIf cfg.efi {
|
||||||
device = "/dev/disk/by-label/ESP";
|
device = "/dev/disk/by-label/ESP";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.loader.efi.canTouchEfiVariables = false;
|
boot.loader.efi.canTouchEfiVariables = false;
|
||||||
|
|
|
@ -33,22 +33,18 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
fileSystems."/" = mkIf (!cfg.zfs.enable) (
|
fileSystems."/" = mkIf (!cfg.zfs.enable) {
|
||||||
lib.mkImageMediaOverride {
|
device = "/dev/disk/by-label/nixos";
|
||||||
device = "/dev/disk/by-label/nixos";
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
autoResize = true;
|
||||||
autoResize = true;
|
};
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) (
|
fileSystems."/boot" = mkIf (cfg.efi || cfg.zfs.enable) {
|
||||||
lib.mkImageMediaOverride {
|
# The ZFS image uses a partition labeled ESP whether or not we're
|
||||||
# The ZFS image uses a partition labeled ESP whether or not we're
|
# booting with EFI.
|
||||||
# booting with EFI.
|
device = "/dev/disk/by-label/ESP";
|
||||||
device = "/dev/disk/by-label/ESP";
|
fsType = "vfat";
|
||||||
fsType = "vfat";
|
};
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
boot.growPartition = true;
|
boot.growPartition = true;
|
||||||
boot.kernelParams = [ "console=tty1" ];
|
boot.kernelParams = [ "console=tty1" ];
|
||||||
|
|
|
@ -70,14 +70,12 @@ in
|
||||||
_: value: ((value.mount or null) != null)
|
_: value: ((value.mount or null) != null)
|
||||||
) config.openstack.zfs.datasets;
|
) config.openstack.zfs.datasets;
|
||||||
in
|
in
|
||||||
lib.mkImageMediaOverride (
|
lib.mapAttrs' (
|
||||||
lib.mapAttrs' (
|
dataset: opts:
|
||||||
dataset: opts:
|
lib.nameValuePair opts.mount {
|
||||||
lib.nameValuePair opts.mount {
|
device = dataset;
|
||||||
device = dataset;
|
fsType = "zfs";
|
||||||
fsType = "zfs";
|
}
|
||||||
}
|
) mountable;
|
||||||
) mountable
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,13 +306,7 @@ with lib;
|
||||||
''
|
''
|
||||||
${vma}/bin/vma create "${config.image.baseName}.vma" \
|
${vma}/bin/vma create "${config.image.baseName}.vma" \
|
||||||
-c ${
|
-c ${
|
||||||
cfgFile "qemu-server.conf" (
|
cfgFile "qemu-server.conf" (cfg.qemuConf // cfg.qemuExtraConf)
|
||||||
(builtins.removeAttrs cfg.qemuConf [ "diskSize" ])
|
|
||||||
// {
|
|
||||||
inherit (config.virtualisation) diskSize;
|
|
||||||
}
|
|
||||||
// cfg.qemuExtraConf
|
|
||||||
)
|
|
||||||
}/qemu-server.conf drive-virtio0=$diskImage
|
}/qemu-server.conf drive-virtio0=$diskImage
|
||||||
rm $diskImage
|
rm $diskImage
|
||||||
${pkgs.zstd}/bin/zstd "${config.image.baseName}.vma"
|
${pkgs.zstd}/bin/zstd "${config.image.baseName}.vma"
|
||||||
|
@ -352,16 +346,14 @@ with lib;
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
"/" = {
|
device = "/dev/disk/by-label/nixos";
|
||||||
device = "/dev/disk/by-label/nixos";
|
autoResize = true;
|
||||||
autoResize = true;
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
};
|
||||||
};
|
fileSystems."/boot" = lib.mkIf hasBootPartition {
|
||||||
"/boot" = lib.mkIf hasBootPartition {
|
device = "/dev/disk/by-label/ESP";
|
||||||
device = "/dev/disk/by-label/ESP";
|
fsType = "vfat";
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = mkIf cfg.cloudInit.enable {
|
networking = mkIf cfg.cloudInit.enable {
|
||||||
|
|
|
@ -275,7 +275,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems =
|
fileSystems =
|
||||||
lib.mkImageMediaOverride {
|
{
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
autoResize = true;
|
autoResize = true;
|
||||||
|
|
|
@ -83,17 +83,15 @@ in
|
||||||
inherit config lib pkgs;
|
inherit config lib pkgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems = lib.mkImageMediaOverride {
|
fileSystems."/" = {
|
||||||
"/" = {
|
device = "/dev/disk/by-label/nixos";
|
||||||
device = "/dev/disk/by-label/nixos";
|
autoResize = true;
|
||||||
autoResize = true;
|
fsType = "ext4";
|
||||||
fsType = "ext4";
|
};
|
||||||
};
|
|
||||||
|
|
||||||
"/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-label/ESP";
|
device = "/dev/disk/by-label/ESP";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.growPartition = true;
|
boot.growPartition = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue