Files
dotfiles/nix/disks.nix
2025-09-22 18:11:37 +01:00

67 lines
1.7 KiB
Nix

{
lib,
inputs,
...
}:
{
imports = [
inputs.disko.nixosModules.disko
];
disko.devices = {
disk = {
main = {
device = lib.mkDefault "nvme-CT1000P2SSD8_2221E632CD1F";
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" ];
};
};
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";
};
"@blackhole" = {
mountpoint = "/var/blackhole";
};
};
};
};
};
};
};
};
};
}