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