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

View File

@@ -63,6 +63,7 @@
url = "github:Nixos/nixpkgs?rev=8fcb6f1c4948305af52d19f887b89011ee2c080d"; url = "github:Nixos/nixpkgs?rev=8fcb6f1c4948305af52d19f887b89011ee2c080d";
}; };
font-patcher.url = "github:Doloro1978/nix-nerd-fonts-patcher"; font-patcher.url = "github:Doloro1978/nix-nerd-fonts-patcher";
inputs.nixos-hardware.url = "github:NixOS/nixos-hardware/master";
}; };
outputs = outputs =
inputs@{ inputs@{
@@ -154,6 +155,7 @@
}; };
inherit (utils) mkHost; inherit (utils) mkHost;
configurations = [ configurations = [
# Desktops
(mkHost { (mkHost {
hardware = "doloro"; hardware = "doloro";
host = "doloro"; host = "doloro";
@@ -173,6 +175,16 @@
rocmSupport = false; rocmSupport = false;
}; };
}) })
# Servers
(mkHost {
hardware = "rpi-5";
host = "rpi-5";
system = "aarch64-linux";
stateVersion = "25.11";
nixpkgsConfig = {
rocmSupport = false;
};
})
]; ];
in in
(utils.deepMerge configurations); (utils.deepMerge configurations);

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";
};
};
};
};
};
};
};
};
};
}

1
hardwares/rpi-5/home.nix Normal file
View File

@@ -0,0 +1 @@
{...}: {}

View File

@@ -0,0 +1,7 @@
{ lib, inputs, ... }:
{
imports = [
./disks.nix
inputs.nixos-hardware.nixosModules.raspberry-pi-4
];
}