wip(rpi-5): working on rpi-5 server support

This commit is contained in:
2026-01-20 21:36:23 +00:00
parent 92010eedb7
commit a0d8a1b0e3
4 changed files with 84 additions and 0 deletions

64
hardwares/rpi-5/disks.nix Normal file
View File

@@ -0,0 +1,64 @@
{ inputs, ... }:
{
imports = [ inputs.disko.nixosModules.disko ];
disko.devices = {
disk = {
main = {
device = "/dev/mmcblk0";
type = "disk";
content = {
type = "gpt";
partitions = {
boot = {
name = "boot";
size = "1M";
type = "EF02";
};
ESP = {
name = "ESP";
priority = 1;
size = "4G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
plainSwap = {
size = "8G";
content = {
type = "swap";
discardPolicy = "both"; # Both "once" and page discard policies
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"@" = {
mountpoint = "/";
};
# Subvolume name is the same as the mountpoint
"@home" = {
mountpoint = "/home";
};
# Parent is not mounted so the mountpoint must be set
"@nix" = {
mountpoint = "/nix";
};
};
};
};
};
};
};
};
};
}