2024-07-01 12:47:35 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-07-03 11:56:10 -04:00
|
|
|
bootUUID = "FC20-D155"; # The UUID of the boot partition.
|
2024-07-03 11:43:21 -04:00
|
|
|
luksUUID = "9fdc521b-a037-4070-af47-f54da03675e4"; # The UUID of the locked LUKS partition.
|
|
|
|
rootUUID = "dfb4fc8f-e82b-43a1-91c1-a77acb6337cb"; # The UUID of the unlocked filesystem partition.
|
2024-07-01 12:47:35 -04:00
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"nvme"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"sdhci_pci"
|
|
|
|
];
|
2024-07-02 18:15:37 -04:00
|
|
|
luks.devices."luks-${luksUUID}" = {
|
|
|
|
device = "/dev/disk/by-uuid/${luksUUID}";
|
2024-07-01 12:47:35 -04:00
|
|
|
crypttabExtraOpts = [ "tpm2-device=auto" ]; # Enable TPM auto-unlocking
|
|
|
|
};
|
|
|
|
};
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
extraModulePackages = [ ];
|
|
|
|
};
|
|
|
|
|
2024-07-02 18:15:37 -04:00
|
|
|
# Configure the main filesystem.
|
|
|
|
aux.system.filesystem.btrfs = {
|
|
|
|
enable = true;
|
|
|
|
devices = {
|
2024-07-03 11:56:10 -04:00
|
|
|
boot = "/dev/disk/by-uuid/${bootUUID}";
|
2024-07-03 11:43:21 -04:00
|
|
|
btrfs = "/dev/disk/by-uuid/${rootUUID}";
|
2024-07-01 12:47:35 -04:00
|
|
|
};
|
2024-07-02 18:15:37 -04:00
|
|
|
swapFile = {
|
|
|
|
enable = true;
|
|
|
|
size = 16384;
|
2024-07-01 12:47:35 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
|
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
|
|
# still possible to use this option, but it's recommended to use it in conjunction
|
|
|
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
2024-07-02 14:06:34 -04:00
|
|
|
networking = {
|
|
|
|
hostName = "Dimaga";
|
|
|
|
useDHCP = lib.mkDefault true;
|
|
|
|
};
|
2024-07-01 12:47:35 -04:00
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
|
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
}
|