45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
fsOptions = [ "noatime" "ssd" "compress=zstd" ];
|
|
in
|
|
{
|
|
boot.initrd.luks = {
|
|
devices =
|
|
# allow discards on all devices
|
|
builtins.mapAttrs (name: val: val // {allowDiscards = true;})
|
|
{
|
|
"system".device = "/dev/disk/by-uuid/1838cdc5-9b0b-4c46-9f23-9465549eeb92";
|
|
"cryptswap".device = "/dev/disk/by-uuid/ded7d649-ab3a-42ee-ae4a-f8c4ba029e9c";
|
|
};
|
|
reusePassphrases = true;
|
|
};
|
|
|
|
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" ];
|
|
};
|
|
|
|
boot.tmp.useTmpfs = true;
|
|
}
|