1
Fork 0
satellite/hosts/nixos/calypso/filesystems/partitions.nix

101 lines
2.7 KiB
Nix
Raw Permalink Normal View History

2024-08-26 17:38:47 +02:00
{
2024-08-26 18:00:25 +02:00
disks ? [ "/dev/nvme0n1" ],
2024-08-26 17:38:47 +02:00
...
}:
{
disko.devices.disk.main = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "gpt";
partitions = {
# {{{ Boot
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
};
# }}}
# {{{ Luks
luks = {
size = "384G"; # The remaining space is left for windows
content = {
type = "luks";
name = "crypted";
passwordFile = "/hermes/secrets/calypso/disk.key";
settings.allowDiscards = true;
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
2024-08-27 16:28:49 +02:00
# {{{ /
2024-08-27 20:55:57 +02:00
"root" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
};
# }}}
2024-08-28 00:52:27 +02:00
# {{{ /blank
"blank" = {
mountpoint = "/blank";
# should we reuse the `root` options here?
mountOptions = [
"compress=zstd"
"noatime"
];
};
# }}}
2024-08-26 17:38:47 +02:00
# {{{ /swap
2024-08-27 20:55:57 +02:00
"swap" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/.swapvol";
swap.swapfile.size = "20G";
};
# }}}
2024-08-27 16:28:49 +02:00
# {{{ /persist/data
2024-08-27 20:55:57 +02:00
"persist-data" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/persist/data";
mountOptions = [ "compress=zstd" ];
2024-08-26 17:38:47 +02:00
};
# }}}
2024-08-27 16:28:49 +02:00
# {{{ /persist/state
2024-08-27 20:55:57 +02:00
"persist-state" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/persist/state";
mountOptions = [ "compress=zstd" ];
2024-08-26 17:38:47 +02:00
};
# }}}
2024-08-27 16:28:49 +02:00
# {{{ /local/nix
2024-08-27 20:55:57 +02:00
"local-nix" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
# }}}
2024-08-27 16:36:17 +02:00
# {{{ /local/cache
2024-08-27 20:55:57 +02:00
"local-cache" = {
2024-08-26 17:38:47 +02:00
mountpoint = "/persist/local/cache";
mountOptions = [
"compress=zstd"
"noatime"
];
};
# }}}
};
};
};
};
# }}}
};
};
};
}