mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-18 00:19:12 +00:00
hosts/plover: add disko device config
This commit is contained in:
parent
9af237e242
commit
cb54c33afc
@ -42,6 +42,11 @@ in
|
||||
./modules/services/wireguard.nix
|
||||
];
|
||||
|
||||
# Automatic format and partitioning.
|
||||
disko.devices = import ./disko.nix {
|
||||
disks = [ "/dev/sda" ];
|
||||
};
|
||||
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
domain = "foodogsquared.one";
|
||||
|
47
hosts/plover/disko.nix
Normal file
47
hosts/plover/disko.nix
Normal 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 = "/";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -18,22 +18,16 @@ in
|
||||
|
||||
# Hetzner can only support non-UEFI bootloader (or at least it doesn't with
|
||||
# systemd-boot).
|
||||
boot.loader.grub.enable = lib.mkForce true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub = {
|
||||
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.kernelModules = [ "nvme" ];
|
||||
|
||||
fileSystems."/" = {
|
||||
label = "nixos";
|
||||
fsType = "ext4";
|
||||
options = [ "defaults" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
label = "boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
|
Loading…
Reference in New Issue
Block a user