nixconfigs/hosts/framenix/storage.nix

56 lines
1.1 KiB
Nix
Raw Permalink Normal View History

{
config,
lib,
pkgs,
...
}:
2024-01-11 01:13:42 +01:00
let
fsOptions = [
"noatime"
"ssd"
"compress=zstd"
];
2024-01-11 01:13:42 +01:00
in
{
boot.initrd.luks = {
devices =
# allow discards on all devices
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";
"cryptswap".device = "/dev/disk/by-uuid/ded7d649-ab3a-42ee-ae4a-f8c4ba029e9c";
2024-01-11 01:13:42 +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;
fileSystems = [
"/"
"/home"
];
2024-01-11 01:13:42 +01:00
};
boot.tmp.useTmpfs = true;
}