nix/hosts/nixos-laptop/hardware-configuration.nix

39 lines
1.2 KiB
Nix
Raw Normal View History

2023-08-15 03:10:15 +02:00
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
2023-08-15 03:10:15 +02:00
fileSystems."/" = {
device = "/dev/disk/by-label/ROOT";
fsType = "btrfs";
options = [ "subvol=@" ];
};
2023-08-15 03:10:15 +02:00
boot.initrd.luks.devices."DISK".device = "/dev/nvme0n1p1";
2023-08-15 03:10:15 +02:00
fileSystems."/boot" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
2023-08-15 03:10:15 +02:00
# Enable Swap on LUKS
boot.initrd.luks.devices."SWAP" = {
device = "/dev/nvme0n1p2";
keyFile = "/crypto_keyfile.bin";
};
2023-08-15 03:10:15 +02:00
# Set up the keyfile
boot.initrd.secrets."/crypto_keyfile.bin" = null;
# Hibernation resume device
boot.resumeDevice = "/dev/disk/by-label/SWAP";
# Confirm the swap devices
swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2023-08-15 03:10:15 +02:00
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}