2024-03-16 17:18:20 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2024-01-11 01:13:42 +01:00
|
|
|
let
|
2024-03-16 17:18:20 +01:00
|
|
|
fsOptions = [
|
|
|
|
"noatime"
|
|
|
|
"ssd"
|
|
|
|
"compress=zstd"
|
|
|
|
];
|
2024-01-11 01:13:42 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
boot.initrd.luks = {
|
|
|
|
devices =
|
|
|
|
# allow discards on all devices
|
2024-03-16 17:18:20 +01:00
|
|
|
builtins.mapAttrs (name: val: val // { allowDiscards = true; }) {
|
2024-01-11 01:13:42 +01:00
|
|
|
"system".device = "/dev/disk/by-uuid/1838cdc5-9b0b-4c46-9f23-9465549eeb92";
|
2024-03-16 17:18:20 +01:00
|
|
|
"cryptswap".device = "/dev/disk/by-uuid/ded7d649-ab3a-42ee-ae4a-f8c4ba029e9c";
|
2024-01-11 01:13:42 +01:00
|
|
|
};
|
2024-03-16 17:18:20 +01:00
|
|
|
reusePassphrases = true;
|
2024-01-11 01:13:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-uuid/22388786-4285-403b-9994-e9aae1f11172";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options = fsOptions ++ [ "subvol=nixos_root" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
"/home" = {
|
|
|
|
device = "/dev/disk/by-uuid/22388786-4285-403b-9994-e9aae1f11172";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options = fsOptions ++ [ "subvol=home" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/AF8E-E9E6";
|
|
|
|
fsType = "vfat";
|
|
|
|
options = [ "discard" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.fstrim.enable = true;
|
|
|
|
services.btrfs.autoScrub = {
|
|
|
|
enable = true;
|
2024-03-16 17:18:20 +01:00
|
|
|
fileSystems = [
|
|
|
|
"/"
|
|
|
|
"/home"
|
|
|
|
];
|
2024-01-11 01:13:42 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
boot.tmp.useTmpfs = true;
|
|
|
|
}
|