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/hardened.nix"
./disko.nix
./modules
];
@ -37,11 +39,6 @@
wireguard.enable = true;
};
# Automatic format and partitioning.
disko.devices = import ./disko.nix {
disks = [ "/dev/sda" ];
};
# Offline SSH!?!
programs.mosh.enable = true;

View File

@ -1,47 +1,48 @@
{ disks ? [ "/dev/sda" ], ... }:
{ config, lib, ... }:
{
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" ];
}
disko.devices = {
disk.sda = {
device = [ "/dev/sda" ];
type = "disk";
content = {
type = "gpt";
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 = "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 = "/";
};
}
];
{
name = "root";
start = "256MiB";
end = "100%";
part-type = "primary";
bootable = true;
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
}
];
};
};
};
}