mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-11 07:02:41 +02:00
fix: problem in proxmox-hardware-configuration
This commit is contained in:
@@ -9,14 +9,6 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
let
|
|
||||||
bios = "seabios";
|
|
||||||
partitionTableType = if bios == "seabios" then "legacy" else "efi";
|
|
||||||
supportEfi = partitionTableType == "efi" || partitionTableType == "hybrid";
|
|
||||||
supportBios = partitionTableType == "legacy" || partitionTableType == "hybrid" || partitionTableType == "legacy+gpt";
|
|
||||||
hasBootPartition = partitionTableType == "efi" || partitionTableType == "hybrid";
|
|
||||||
hasNoFsPartition = partitionTableType == "hybrid" || partitionTableType == "legacy+gpt";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# DO NOT promote ryan to input password for sudo.
|
# DO NOT promote ryan to input password for sudo.
|
||||||
@@ -37,18 +29,14 @@ in
|
|||||||
growPartition = true;
|
growPartition = true;
|
||||||
kernelParams = [ "console=ttyS0" ];
|
kernelParams = [ "console=ttyS0" ];
|
||||||
loader.grub = {
|
loader.grub = {
|
||||||
device = lib.mkDefault (if (hasNoFsPartition || supportBios) then
|
device = "/dev/vda";
|
||||||
# Even if there is a separate no-fs partition ("/dev/disk/by-partlabel/no-fs" i.e. "/dev/vda2"),
|
|
||||||
# which will be used the bootloader, do not set it as loader.grub.device.
|
# we do not support EFI, so disable it.
|
||||||
# GRUB installation fails, unless the whole disk is selected.
|
efiSupport = false;
|
||||||
"/dev/vda"
|
efiInstallAsRemovable = false;
|
||||||
else
|
|
||||||
"nodev");
|
|
||||||
efiSupport = lib.mkDefault supportEfi;
|
|
||||||
efiInstallAsRemovable = lib.mkDefault supportEfi;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
loader.timeout = 0;
|
loader.timeout = 3; # wait for 3 seconds to select the boot entry
|
||||||
initrd.availableKernelModules = [ "uas" "virtio_blk" "virtio_pci" ];
|
initrd.availableKernelModules = [ "uas" "virtio_blk" "virtio_pci" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -57,10 +45,8 @@ in
|
|||||||
autoResize = true;
|
autoResize = true;
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
fileSystems."/boot" = lib.mkIf hasBootPartition {
|
# we do not have a /boot partition, so do not mount it.
|
||||||
device = "/dev/disk/by-label/ESP";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
# it alse had qemu-guest-agent installed by default.
|
# it alse had qemu-guest-agent installed by default.
|
||||||
services.qemuGuest.enable = lib.mkDefault true;
|
services.qemuGuest.enable = lib.mkDefault true;
|
||||||
|
|||||||
Reference in New Issue
Block a user