1
0
Fork 0
nix-configuration/templates/systems/hardware-configuration.nix

41 lines
899 B
Nix
Raw Permalink Normal View History

# Template for setting a new host's hardware configuration
{
modulesPath,
namespace,
...
}:
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.
2024-12-06 18:04:47 +00:00
${namespace}.filesystem = {
enable = true;
partitions = {
boot = "/dev/disk/by-uuid/${bootUUID}";
luks = "/dev/disk/by-uuid/${luksUUID}";
};
swapFile = {
enable = true;
size = 16384;
};
};
}