{ config , lib , pkgs , modulesPath , system , inputs , ... }: { # bcachefs format \ # --metadata_replicas=2 \ # --data_replicas=1 \ # --background_compression=zstd \ # --discard \ # --label=ssd.ssd_4t /dev/mapper/crypt_ssd_4t_data \ # --label=ssd.ssd_2t /dev/mapper/crypt_ssd_2t_data config = { boot = { supportedFilesystems = [ "btrfs" "vfat" ]; initrd.supportedFilesystems = [ "btrfs" "vfat" ]; initrd.luks.devices = lib.attrsets.mergeAttrsList ( lib.lists.forEach [ "crypt_ssd_4t_data" "crypt_ssd_4t_swap" "crypt_ssd_2t_data" "crypt_ssd_2t_swap" ] (drive: { "${drive}" = { device = "/dev/disk/by-partlabel/${drive}"; allowDiscards = true; bypassWorkqueues = true; # crypttabExtraOpts = [ "nofail" ]; }; }) ); }; fileSystems = { "/" = { device = "/dev/mapper/crypt_ssd_4t_data"; # device = "UUID=f89215ba-3313-42d3-8f68-051ad2453870"; fsType = "btrfs"; options = [ "rw" "autodefrag" "compress=zstd" "discard=async" "relatime" "space_cache=v2" "ssd" ]; }; "/boot" = { device = "/dev/disk/by-uuid/05A2-6A8A"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; }; swapDevices = [ # { device = "/dev/disk/by-uuid/a8f478f0-ad5e-47ae-8e18-63060f7e5706"; } # { device = "/dev/disk/by-uuid/59987b2a-c5c5-4547-95ad-f0d1dcdf8458"; } ]; system.fsPackages = [ pkgs.sshfs ]; }; }