Nix-Configs/configs/filesystems.nix

55 lines
1.1 KiB
Nix
Raw Normal View History

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
{
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
# 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";
};
2023-02-01 03:05:43 +00:00
"/tmp" = {
device = "none";
fsType = "tmpfs";
options = [
"size=75%"
"mode=777"
];
};
2022-12-18 17:05:43 +00:00
"/boot/efi" = {
device = systemInformation.efiPartition;
fsType = "vfat";
};
};
swapDevices = [
{
device = "/dev/mapper/cryptoswap";
discardPolicy = "both";
}
];
}