79 lines
2.4 KiB
Nix
79 lines
2.4 KiB
Nix
|
{ ... }:
|
||
|
{
|
||
|
disko.devices = {
|
||
|
disk = {
|
||
|
nvme0n1 = {
|
||
|
type = "disk";
|
||
|
device = "/dev/nvme0n1";
|
||
|
content = {
|
||
|
type = "gpt";
|
||
|
partitions = {
|
||
|
ESP = {
|
||
|
priority = 1;
|
||
|
start = "1M";
|
||
|
end = "512M";
|
||
|
type = "EF00";
|
||
|
content = {
|
||
|
type = "filesystem";
|
||
|
format = "vfat";
|
||
|
mountpoint = "/boot";
|
||
|
};
|
||
|
};
|
||
|
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
|
||
|
"/root" = {
|
||
|
mountpoint = "/";
|
||
|
mountOptions = [ "subvol=root" "compress=zstd" "noatime" ];
|
||
|
};
|
||
|
# Subvolume name is the same as the mountpoint
|
||
|
"/home" = {
|
||
|
mountpoint = "/home";
|
||
|
mountOptions = [ "subvol=home" "compress=zstd" "noatime" ];
|
||
|
};
|
||
|
# Parent is not mounted so the mountpoint must be set
|
||
|
"/nix" = {
|
||
|
mountpoint = "/nix";
|
||
|
mountOptions = [ "subvol=nix" "compress=zstd" "noatime" ];
|
||
|
};
|
||
|
# Subvolume for the swapfile
|
||
|
"/swap" = {
|
||
|
mountpoint = "/swap";
|
||
|
swap = {
|
||
|
swapfile.size = "64G";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
# luks = {
|
||
|
# size = "100%";
|
||
|
# content = {
|
||
|
# type = "luks";
|
||
|
# name = "crypted";
|
||
|
# # disable settings.keyFile if you want to use interactive password entry
|
||
|
# #passwordFile = "/tmp/secret.key"; # Interactive
|
||
|
# settings = {
|
||
|
# allowDiscards = true;
|
||
|
# keyFile = "/tmp/secret.key";
|
||
|
# };
|
||
|
# additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
|
||
|
# content = {
|
||
|
# ...
|
||
|
# };
|
||
|
# };
|
||
|
# };
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|