1
0
Fork 0
nix-configuration/systems/x86_64-linux/Khanda/hardware-configuration.nix

91 lines
2.3 KiB
Nix
Raw Normal View History

2024-04-28 15:54:53 +00:00
# Surface Pro 9
{
config,
lib,
pkgs,
modulesPath,
2024-12-06 18:04:47 +00:00
namespace,
...
}:
2024-07-03 19:10:33 +00:00
let
bootUUID = "6579-B6CB"; # The UUID of the boot partition.
luksUUID = "9936b186-96a5-4e43-9aba-0e0a0eb587df"; # The UUID of the locked LUKS partition.
2024-07-03 19:10:33 +00:00
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
# NOTE: Uncomment to use a default kernel and skip full kernel rebuilds
#kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
kernelModules = [ "kvm-intel" ];
# NOTE: Loading the camera driver results in a kernel panic on 6.10 kernels. See https://github.com/linux-surface/linux-surface/issues/1516
blacklistedKernelModules = [
"intel-ipu6"
"intel-ipu6-isys"
];
# Enable antenna aggregation
extraModprobeConfig = ''
options iwlwifi 11n_disable=8
'';
2024-12-14 23:00:26 +00:00
initrd.kernelModules = [
"kvm-intel"
"surface_aggregator"
"surface_aggregator_registry"
"surface_aggregator_hub"
"surface_hid_core"
"surface_hid"
"hid_multitouch"
"8250_dw"
"intel_lpss"
"intel_lpss_pci"
"xhci_pci"
"thunderbolt"
"nvme"
"usb_storage"
"sd_mod"
"surface_kbd"
"pinctrl_tigerlake"
];
kernelParams = [
2024-09-03 15:53:45 +00:00
"pci=hpiosize=0" # Prevent ACPI interrupt storm. See https://github.com/linux-surface/linux-surface/wiki/Surface-Pro-9#acpi-interrupt-storm
2024-12-19 20:21:40 +00:00
"i915.perf_stream_paranoid=0" # Enable performance support. See https://wiki.archlinux.org/title/Intel_graphics#Enable_performance_support and https://github.com/NixOS/nixos-hardware/issues/1246
2024-09-03 15:53:45 +00:00
];
};
2024-07-03 19:10:33 +00:00
# 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 = {
2024-07-03 19:10:33 +00:00
enable = true;
size = 16384;
};
};
hardware = {
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2024-12-15 18:07:27 +00:00
/*
FIXME: temporarily disable due to conflict with kernel 6.12+
ipu6 = {
enable = true;
platform = "ipu6ep";
};
*/
};
# Limit the number of cores Nix can use
nix.settings.cores = 8;
# Install/configure additional drivers, particularly for touch
environment.systemPackages = with pkgs; [ libwacom-surface ];
}