2024-07-04 16:27:00 +00:00
|
|
|
# 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 = {
|
2024-07-06 16:50:45 +00:00
|
|
|
enable = true;
|
|
|
|
partitions = {
|
|
|
|
boot = "/dev/disk/by-uuid/${bootUUID}";
|
|
|
|
luks = "/dev/disk/by-uuid/${luksUUID}";
|
2024-07-04 16:27:00 +00:00
|
|
|
};
|
2024-07-06 16:50:45 +00:00
|
|
|
swapFile = {
|
2024-07-04 16:27:00 +00:00
|
|
|
enable = true;
|
2024-07-06 16:50:45 +00:00
|
|
|
size = 16384;
|
2024-07-04 16:27:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|