2024-04-28 11:54:53 -04:00
|
|
|
# Surface Pro 9
|
2024-05-07 18:02:59 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}:
|
2024-07-03 15:10:33 -04:00
|
|
|
let
|
2024-10-02 15:31:15 -04:00
|
|
|
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 15:10:33 -04:00
|
|
|
in
|
2024-05-07 18:02:59 -04:00
|
|
|
{
|
|
|
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
|
|
|
|
|
|
boot = {
|
2024-08-27 17:40:47 -04:00
|
|
|
# NOTE: Uncomment to use a default kernel and skip full kernel rebuilds
|
|
|
|
#kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
|
|
|
|
|
2024-09-14 11:19:55 -04:00
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
|
2024-08-12 20:09:08 -04:00
|
|
|
# Enable antenna aggregation
|
|
|
|
extraModprobeConfig = ''
|
|
|
|
options iwlwifi 11n_disable=8
|
|
|
|
'';
|
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [
|
2024-10-18 16:14:33 -04:00
|
|
|
"kvm-intel"
|
2024-05-07 18:02:59 -04:00
|
|
|
"surface_aggregator"
|
|
|
|
"surface_aggregator_registry"
|
|
|
|
"surface_aggregator_hub"
|
|
|
|
"surface_hid_core"
|
2024-10-18 16:14:33 -04:00
|
|
|
"surface_hid"
|
2024-05-07 18:02:59 -04:00
|
|
|
"hid_multitouch"
|
|
|
|
"8250_dw"
|
|
|
|
"intel_lpss"
|
|
|
|
"intel_lpss_pci"
|
|
|
|
"xhci_pci"
|
|
|
|
"thunderbolt"
|
|
|
|
"nvme"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"surface_kbd"
|
|
|
|
"pinctrl_tigerlake"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-09-02 15:11:27 -04:00
|
|
|
kernelParams = [
|
2024-09-03 11:53:45 -04:00
|
|
|
"pci=hpiosize=0" # Prevent ACPI interrupt storm. See https://github.com/linux-surface/linux-surface/wiki/Surface-Pro-9#acpi-interrupt-storm
|
|
|
|
];
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
|
|
|
|
2024-07-03 15:10:33 -04:00
|
|
|
# Configure the main filesystem.
|
2024-07-03 21:13:13 -04:00
|
|
|
aux.system.filesystem = {
|
2024-07-05 09:36:11 -04:00
|
|
|
enable = true;
|
|
|
|
partitions = {
|
|
|
|
boot = "/dev/disk/by-uuid/${bootUUID}";
|
|
|
|
luks = "/dev/disk/by-uuid/${luksUUID}";
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
2024-07-05 09:36:11 -04:00
|
|
|
swapFile = {
|
2024-07-03 15:10:33 -04:00
|
|
|
enable = true;
|
2024-07-05 09:36:11 -04:00
|
|
|
size = 16384;
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-08 14:36:28 -04:00
|
|
|
hardware = {
|
|
|
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
2024-08-17 15:33:12 -04:00
|
|
|
ipu6 = {
|
2024-09-10 18:45:36 -04:00
|
|
|
enable = true;
|
2024-08-17 15:33:12 -04:00
|
|
|
platform = "ipu6ep";
|
|
|
|
};
|
2024-06-08 14:36:28 -04:00
|
|
|
};
|
2024-05-07 18:02:59 -04:00
|
|
|
|
2024-08-27 17:40:47 -04:00
|
|
|
# Limit the number of cores Nix can use
|
|
|
|
nix.settings.cores = 8;
|
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
# Install/configure additional drivers, particularly for touch
|
|
|
|
environment.systemPackages = with pkgs; [ libwacom-surface ];
|
2024-04-23 14:46:17 -04:00
|
|
|
}
|