2022-12-18 17:05:43 +00:00
|
|
|
{ config, lib, pkgs, modulesPath, ... }:
|
2022-12-18 18:49:19 +00:00
|
|
|
let systemInformation = import ../system/system-information.nix; in
|
2022-12-18 17:05:43 +00:00
|
|
|
{
|
2023-03-17 14:33:20 +00:00
|
|
|
boot.tmpOnTmpfs = true;
|
|
|
|
boot.tmpOnTmpfsSize = "75%";
|
2022-12-18 17:05:43 +00:00
|
|
|
boot.initrd.luks.devices = {
|
|
|
|
cryptoroot = {
|
|
|
|
device = systemInformation.rootPartition;
|
|
|
|
allowDiscards = true;
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
};
|
|
|
|
cryptoswap = {
|
|
|
|
device = systemInformation.swapPartition;
|
|
|
|
keyFile = "/crypto_keyfile.bin";
|
|
|
|
allowDiscards = true;
|
|
|
|
bypassWorkqueues = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/mapper/cryptoroot";
|
|
|
|
options = [
|
|
|
|
"defaults"
|
|
|
|
|
|
|
|
# Batch journaling commits to 2 minutes for power saving
|
|
|
|
# https://wiki.archlinux.org/title/Power_management#Writeback_Time
|
|
|
|
"commit=120"
|
2022-12-18 17:39:10 +00:00
|
|
|
|
2023-03-21 19:42:03 +00:00
|
|
|
# Turn on zstd compression
|
|
|
|
"compress=zstd"
|
|
|
|
|
2022-12-18 17:39:10 +00:00
|
|
|
# Performance optimizations for SSD
|
|
|
|
"noatime"
|
|
|
|
"nodiratime"
|
|
|
|
"discard"
|
2022-12-18 17:05:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Uncomment this once the root fs is actually btrfs
|
|
|
|
# fsType = "btrfs";
|
|
|
|
};
|
|
|
|
"/boot/efi" = {
|
|
|
|
device = systemInformation.efiPartition;
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
swapDevices = [
|
|
|
|
{
|
|
|
|
device = "/dev/mapper/cryptoswap";
|
|
|
|
discardPolicy = "both";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|