Files
nix-config/modules/nixos/disko/aarch64-linux/default.nix
mjallen18 caa326d496 test
2025-07-29 18:26:50 -05:00

121 lines
2.9 KiB
Nix

{
lib,
system,
...
}:
let
isArm = builtins.match "aarch64*" system != null;
rootDisk = "/dev/nvme0n1";
in
{
config = lib.mkIf isArm {
disko.devices = {
nodev."/" = {
fsType = "tmpfs";
mountOptions = [
"mode=755"
"defaults"
"size=2G"
];
};
# root disk setup
disk.main = {
type = "disk";
device = rootDisk;
imageSize = "15G";
content = {
type = "gpt";
# specify partitions
partitions = {
# /boot/firmware
FIRMWARE = {
priority = 1;
name = "FIRMWARE";
start = "1M";
end = "1G";
type = "0700";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot/firmware";
mountOptions = [ "umask=0077" ];
};
};
# /boot
ESP = {
priority = 2;
name = "ESP";
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
name = "bcachefs-root";
size = "100%";
content = {
type = "bcachefs";
filesystem = "main_fs"; # Reference to filesystem below
extraFormatArgs = [ "--discard" ];
};
};
};
};
};
bcachefs_filesystems = {
main_fs = {
type = "bcachefs_filesystem";
extraFormatArgs = [
"--compression=zstd"
"--background_compression=zstd"
];
subvolumes = {
# Root subvolume
"subvolumes/root" = {
mountpoint = "/root";
mountOptions = [
"noatime"
];
};
# Home subvolume
"subvolumes/home" = {
mountpoint = "/home";
};
# Nix store
"subvolumes/nix" = {
mountpoint = "/nix";
mountOptions = [
"noatime"
];
};
# Etc
"subvolumes/etc" = {
mountpoint = "/etc";
mountOptions = [
"noatime"
];
};
# Tmp
"subvolumes/tmp" = {
mountpoint = "/tmp";
mountOptions = [
"noatime"
];
};
# Log
"subvolumes/log" = {
mountpoint = "/var/log";
mountOptions = [
"noatime"
];
};
};
};
};
};
};
}