2024-04-28 11:54:53 -04:00
|
|
|
# Surface Pro 9
|
2024-05-07 18:02:59 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
modulesPath,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
|
|
|
|
|
|
boot = {
|
|
|
|
initrd = {
|
|
|
|
availableKernelModules = [
|
|
|
|
"surface_aggregator"
|
|
|
|
"surface_aggregator_registry"
|
|
|
|
"surface_aggregator_hub"
|
|
|
|
"surface_hid_core"
|
|
|
|
"hid_multitouch"
|
|
|
|
"8250_dw"
|
|
|
|
"intel_lpss"
|
|
|
|
"intel_lpss_pci"
|
|
|
|
"xhci_pci"
|
|
|
|
"thunderbolt"
|
|
|
|
"nvme"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"surface_kbd"
|
|
|
|
"pinctrl_tigerlake"
|
|
|
|
];
|
|
|
|
kernelModules = [
|
|
|
|
"surface_aggregator"
|
|
|
|
"surface_aggregator_registry"
|
|
|
|
"surface_aggregator_hub"
|
|
|
|
"surface_hid_core"
|
|
|
|
"surface_hid"
|
|
|
|
"hid_multitouch"
|
|
|
|
"8250_dw"
|
|
|
|
"intel_lpss"
|
|
|
|
"intel_lpss_pci"
|
|
|
|
"surface_kbd"
|
|
|
|
"pinctrl_tigerlake"
|
|
|
|
];
|
|
|
|
|
|
|
|
luks.devices."luks-bd1fe396-6740-4e7d-af2c-26ca9a3031f1" = {
|
|
|
|
device = "/dev/disk/by-uuid/bd1fe396-6740-4e7d-af2c-26ca9a3031f1";
|
|
|
|
crypttabExtraOpts = [ "tpm2-device=auto" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-21 14:26:32 -04:00
|
|
|
kernel.sysctl = {
|
|
|
|
# Try to reduce swappiness - Khanda hates paging, even to NVMe storage
|
|
|
|
"vm.swappiness" = 20;
|
|
|
|
};
|
|
|
|
|
2024-05-07 18:02:59 -04:00
|
|
|
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"
|
|
|
|
"surface_kbd"
|
|
|
|
"pinctrl_tigerlake"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-uuid/b34afd29-94ff-421b-bb96-8497951abf58";
|
|
|
|
fsType = "btrfs";
|
2024-06-14 13:36:41 -04:00
|
|
|
options = [ "subvol=@,compress=zstd,nodiscard" ];
|
2024-05-07 18:02:59 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-uuid/DD2A-9C83";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
swapDevices = [ { device = "/dev/disk/by-uuid/8c2519d9-3e47-4aa1-908d-98b1aa8b909d"; } ];
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
useDHCP = lib.mkDefault true;
|
|
|
|
hostName = "Khanda";
|
|
|
|
};
|
|
|
|
|
|
|
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
2024-06-08 14:36:28 -04:00
|
|
|
hardware = {
|
|
|
|
cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
|
|
# Enable camera driver
|
|
|
|
# NOTE: Currently results in a build failure. For updates, see https://github.com/NixOS/nixpkgs/issues/303067
|
|
|
|
/*
|
|
|
|
ipu6 = {
|
|
|
|
enable = true;
|
|
|
|
platform = "ipu6ep";
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
};
|
2024-05-07 18:02:59 -04:00
|
|
|
|
|
|
|
# Install/configure additional drivers, particularly for touch
|
|
|
|
environment.systemPackages = with pkgs; [ libwacom-surface ];
|
|
|
|
|
|
|
|
# NOTE: Use a default kernel to skip full kernel rebuilds
|
2024-06-24 13:08:18 -04:00
|
|
|
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_latest;
|
2024-04-23 14:46:17 -04:00
|
|
|
}
|