flake/hosts/aristotle/disko.nix

79 lines
1.9 KiB
Nix
Raw Normal View History

2024-07-09 23:12:02 +00:00
let
disks = ["/dev/nvme0n1"];
# compress-force: https://t.me/archlinuxcn_group/3054167
mountOptions = ["defaults" "compress-force=zstd" "noatime"];
2024-01-17 10:40:06 +00:00
cryptSettings = {
allowDiscards = true;
bypassWorkqueues = true;
};
in {
2023-10-12 14:21:14 +00:00
disko.devices = {
disk = {
"one" = {
type = "disk";
device = builtins.elemAt disks 0;
content = {
type = "gpt";
partitions = {
2024-01-02 17:58:12 +00:00
"esp" = {
2023-10-12 14:21:14 +00:00
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
2024-01-13 07:20:06 +00:00
mountOptions = ["defaults" "umask=007"];
2023-10-12 14:21:14 +00:00
};
};
2024-07-23 16:14:27 +00:00
"cryptroot" = {
2023-10-12 14:21:14 +00:00
end = "-16G";
content = {
type = "luks";
2024-07-23 16:14:27 +00:00
name = "cryptroot";
2024-01-17 10:40:06 +00:00
settings = cryptSettings;
2023-10-12 14:21:14 +00:00
content = {
type = "btrfs";
2024-01-17 10:40:06 +00:00
subvolumes = {
2023-10-12 14:21:14 +00:00
"/@nix" = {
mountpoint = "/nix";
2024-01-13 07:20:06 +00:00
inherit mountOptions;
2023-10-12 14:21:14 +00:00
};
2023-12-10 15:42:07 +00:00
"/@persist" = {
mountpoint = "/persist";
2024-01-13 07:20:06 +00:00
inherit mountOptions;
2023-12-10 15:42:07 +00:00
};
2023-10-12 14:21:14 +00:00
};
};
};
};
2024-07-23 16:14:27 +00:00
"cryptswap" = {
size = "100%";
2023-10-12 14:21:14 +00:00
content = {
2024-01-17 10:40:06 +00:00
type = "luks";
2024-07-23 16:14:27 +00:00
name = "cryptswap";
2024-01-17 10:40:06 +00:00
settings = cryptSettings;
content = {
type = "swap";
resumeDevice = true;
};
2023-10-12 14:21:14 +00:00
};
};
};
};
};
};
nodev = {
"/" = {
fsType = "tmpfs";
mountOptions = [
"defaults"
2024-01-02 17:58:12 +00:00
"size=2G"
2023-10-12 14:21:14 +00:00
"mode=755"
2024-01-02 17:58:12 +00:00
"nodev"
"nosuid"
2023-10-12 14:21:14 +00:00
];
};
};
};
}