1
0
Fork 0
nix-configuration/hosts/hardware-configuration.nix.template

45 lines
938 B
Plaintext

# Template for setting a new host's hardware configuration
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
bootUUID = "ABCD-1234"; # The UUID of the boot partition.
luksUUID = "1408f9cf-68b8-4063-b919-48edde3329a5"; # The UUID of the encrypted LUKS partition.
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# Configure the kernel.
boot = {
# Run `nixos-generate-config --no-filesystems` to generate a baseline hardware configuration.
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
kernelModules = [ ];
};
# Configure the main filesystem.
aux.system.filesystem = {
enable = true;
partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}";
luks = "/dev/disk/by-uuid/${luksUUID}";
};
swapFile = {
enable = true;
size = 16384;
};
};
}