hosts/plover: make disko as a dedicated NixOS module

This commit is contained in:
Gabriel Arazas 2024-02-23 07:25:44 +08:00
parent 643d05a0f7
commit 458b8092dc
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 43 additions and 45 deletions

View File

@ -14,6 +14,8 @@
"${foodogsquaredModulesPath}/profiles/headless.nix" "${foodogsquaredModulesPath}/profiles/headless.nix"
"${foodogsquaredModulesPath}/profiles/hardened.nix" "${foodogsquaredModulesPath}/profiles/hardened.nix"
./disko.nix
./modules ./modules
]; ];
@ -37,11 +39,6 @@
wireguard.enable = true; wireguard.enable = true;
}; };
# Automatic format and partitioning.
disko.devices = import ./disko.nix {
disks = [ "/dev/sda" ];
};
# Offline SSH!?! # Offline SSH!?!
programs.mosh.enable = true; programs.mosh.enable = true;

View File

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