Describe filesystems in config
This commit is contained in:
parent
9334e928f7
commit
7241484049
42
filesystems.nix
Normal file
42
filesystems.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
let systemInformation = import ./system-information.nix; in
|
||||||
|
{
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
|
||||||
|
# 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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -14,6 +14,7 @@
|
||||||
#
|
#
|
||||||
# Also make sure to move the swap configuration to the hardware config
|
# Also make sure to move the swap configuration to the hardware config
|
||||||
/etc/nixos/hardware-configuration.nix
|
/etc/nixos/hardware-configuration.nix
|
||||||
|
./filesystems.nix
|
||||||
<home-manager/nixos>
|
<home-manager/nixos>
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
5
system-information.nix
Normal file
5
system-information.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
rootPartition = "/dev/disk/by-uuid/850e0a62-fd82-4360-b4d7-258817e86380";
|
||||||
|
swapPartition = "/dev/disk/by-uuid/6144d426-6c5f-4a8a-ac16-d4d5eecbf7a0";
|
||||||
|
efiPartition = "/dev/disk/by-uuid/E5A8-38EA";
|
||||||
|
}
|
Loading…
Reference in a new issue