2022-10-20 10:29:37 -04:00
|
|
|
{
|
2024-06-23 05:28:59 -04:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2022-10-20 10:29:37 -04:00
|
|
|
imports = [
|
2024-06-28 14:05:46 -04:00
|
|
|
../.
|
2024-06-28 20:23:23 -04:00
|
|
|
../../../common/gpu/intel/kaby-lake
|
2024-06-23 05:28:59 -04:00
|
|
|
../../../common/gpu/intel
|
|
|
|
../../../common/hidpi.nix
|
2022-10-20 10:29:37 -04:00
|
|
|
../../../common/pc/laptop/ssd
|
2024-06-23 05:28:59 -04:00
|
|
|
../../../common/pc/laptop/acpi_call.nix
|
2022-10-20 10:29:37 -04:00
|
|
|
];
|
|
|
|
|
2024-06-23 05:28:59 -04:00
|
|
|
# Make the keyboard work in stage1, enable iommu
|
2022-10-20 10:29:37 -04:00
|
|
|
# https://www.kernelconfig.io/config_keyboard_applespi
|
|
|
|
|
2024-06-23 05:28:59 -04:00
|
|
|
boot = {
|
|
|
|
initrd.kernelModules = ["applespi" "spi_pxa2xx_platform" "intel_lpss_pci" "applesmc" ];
|
|
|
|
kernelParams = [ "intel_iommu=on" ];
|
|
|
|
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Touchpad quirks to make "disable-while-typing" actually work
|
|
|
|
services.libinput.enable = true;
|
|
|
|
environment.etc."libinput/local-overrides.quirks".text = ''
|
|
|
|
[MacBook(Pro) SPI Touchpads]
|
|
|
|
MatchName=*Apple SPI Touchpad*
|
|
|
|
ModelAppleTouchpad=1
|
|
|
|
AttrTouchSizeRange=200:150
|
|
|
|
AttrPalmSizeThreshold=1100
|
2022-10-20 10:29:37 -04:00
|
|
|
|
2024-06-23 05:28:59 -04:00
|
|
|
[MacBook(Pro) SPI Keyboards]
|
|
|
|
MatchName=*Apple SPI Keyboard*
|
|
|
|
AttrKeyboardIntegration=internal
|
2022-10-20 10:29:37 -04:00
|
|
|
|
2024-06-23 05:28:59 -04:00
|
|
|
[MacBookPro Touchbar]
|
|
|
|
MatchBus=usb
|
|
|
|
MatchVendor=0x05AC
|
|
|
|
MatchProduct=0x8600
|
|
|
|
AttrKeyboardIntegration=internal
|
|
|
|
'';
|
2022-10-20 10:29:37 -04:00
|
|
|
|
2024-06-23 05:28:59 -04:00
|
|
|
# Wifi, CPU Microcode FW updates
|
|
|
|
networking.enableB43Firmware = lib.mkDefault true;
|
|
|
|
hardware = {
|
|
|
|
enableRedistributableFirmware = lib.mkDefault true;
|
|
|
|
cpu.intel.updateMicrocode = lib.mkDefault true;
|
2022-10-20 10:29:37 -04:00
|
|
|
};
|
|
|
|
|
2024-06-28 14:05:46 -04:00
|
|
|
# [Enable only if needed!]
|
2024-06-23 05:28:59 -04:00
|
|
|
# Disable d3cold on older NVME controller, only if needed
|
|
|
|
# https://github.com/Dunedan/mbp-2016-linux
|
2024-06-28 14:05:46 -04:00
|
|
|
#
|
2024-06-23 05:28:59 -04:00
|
|
|
#systemd.services.disable-nvme-d3cold = {
|
|
|
|
# description = "Disables d3cold on the NVME controller";
|
|
|
|
# before = [ "suspend.target" ];
|
|
|
|
# path = [ pkgs.bash pkgs.coreutils ];
|
|
|
|
# serviceConfig.Type = "oneshot";
|
|
|
|
# serviceConfig.ExecStart = "${./disable-nvme-d3cold.sh}";
|
|
|
|
# serviceConfig.TimeoutSec = 0;
|
|
|
|
# wantedBy = [ "multi-user.target" "suspend.target" ];
|
|
|
|
#};
|
2022-10-20 10:29:37 -04:00
|
|
|
}
|