hosts/plover: add disko device config

This commit is contained in:
Gabriel Arazas 2023-06-30 13:38:38 +08:00
parent 9af237e242
commit cb54c33afc
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
3 changed files with 59 additions and 13 deletions

View File

@ -42,6 +42,11 @@ in
./modules/services/wireguard.nix ./modules/services/wireguard.nix
]; ];
# Automatic format and partitioning.
disko.devices = import ./disko.nix {
disks = [ "/dev/sda" ];
};
networking = { networking = {
nftables.enable = true; nftables.enable = true;
domain = "foodogsquared.one"; domain = "foodogsquared.one";

47
hosts/plover/disko.nix Normal file
View File

@ -0,0 +1,47 @@
{ disks ? [ "/dev/sda" ], ... }:
{
disk.sda = {
device = builtins.elemAt disks 0;
type = "disk";
content = {
format = "gpt";
type = "table";
partitions = [
{
name = "boot";
start = "0";
end = "1MiB";
part-type = "primary";
flags = [ "bios_grub" ];
}
{
name = "ESP";
start = "1MiB";
end = "256MiB";
bootable = true;
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
flags = [ "esp" ];
}
{
name = "root";
start = "256MiB";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}
];
};
};
}

View File

@ -18,22 +18,16 @@ in
# Hetzner can only support non-UEFI bootloader (or at least it doesn't with # Hetzner can only support non-UEFI bootloader (or at least it doesn't with
# systemd-boot). # systemd-boot).
boot.loader.grub.enable = lib.mkForce true; boot.loader.grub = {
boot.loader.grub.device = "/dev/sda"; enable = lib.mkForce true;
device = "/dev/sda";
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [ "ata_piix" "virtio_pci" "virtio_scsi" "xhci_pci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "nvme" ]; boot.initrd.kernelModules = [ "nvme" ];
fileSystems."/" = {
label = "nixos";
fsType = "ext4";
options = [ "defaults" ];
};
fileSystems."/boot" = {
label = "boot";
fsType = "vfat";
};
zramSwap.enable = true; zramSwap.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";