diff --git a/apple/imac/18-2/README.md b/apple/imac/18-2/README.md new file mode 100644 index 0000000..7ed259b --- /dev/null +++ b/apple/imac/18-2/README.md @@ -0,0 +1,26 @@ +# iMac 18,2, NixOS 24.05 (2024) + +## Audio +- [ ] broken until https://github.com/NixOS/nixpkgs/pull/322968 lands in master + +## Bluetooth +- [ ] broken until https://github.com/NixOS/nixpkgs/pull/322964 lands in master + +## Thunderbolt +- [x] ok + +## SATA +- [x] ok + +## NVME +- [x] ok, older NVME / Controller may need workaround for resume + +## Suspend/Resumer +- [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). + +## Wifi +- [x] Working (2,4Ghz & 5Ghz supported), WEP3 broken -> brcm fw blob (2015) + +## Resources (Intel iMac/MacBook share similar custom hardware) +- https://github.com/Dunedan/mbp-2016-linux?tab=readme-ov-file +- https://gist.github.com/roadrunner2/1289542a748d9a104e7baec6a92f9cd7 diff --git a/apple/imac/18-2/default.nix b/apple/imac/18-2/default.nix new file mode 100644 index 0000000..fbbfeba --- /dev/null +++ b/apple/imac/18-2/default.nix @@ -0,0 +1,30 @@ +{ + config, + lib, + pkgs, + ... +}: { + imports = [ + ../. + ../../../common/cpu/intel/kaby-lake + ../../../common/gpu/intel + ../../../common/gpu/amd + ../../../common/hidpi.nix + ../../../common/pc/laptop/ssd + ../../../common/pc/laptop/acpi_call.nix + ]; + + # apple smc (TODO: check spi) + 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; + }; + + # Wifi, CPU Microcode FW updates + networking.enableB43Firmware = lib.mkDefault true; + hardware = { + enableRedistributableFirmware = lib.mkDefault true; + cpu.intel.updateMicrocode = lib.mkDefault true; + }; +} diff --git a/apple/imac/default.nix b/apple/imac/default.nix new file mode 100644 index 0000000..ea15175 --- /dev/null +++ b/apple/imac/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ../. + ../../common/cpu/intel + ../../common/pc/laptop + ../../common/pc/laptop/ssd + ]; +} diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index 0a0e2df..ce74d7c 100644 --- a/apple/macbook-pro/14-1/README.md +++ b/apple/macbook-pro/14-1/README.md @@ -1,25 +1,25 @@ -# MacBook Pro 14,1, NixOS 24.01 (2024) +# MacBook Pro 14,1, NixOS 24.05 (2024) ## Audio - [ ] Still broken, use usb/hdmi instead, nixos pkg needed: https://github.com/davidjo/snd_hda_macbookpro + - [ ] broken until https://github.com/NixOS/nixpkgs/pull/322968 lands in master ## Bluetooth - [ ] Still broken, even (hacky) workaround does not work any more with latest driver updates + - [ ] broken lands https://github.com/NixOS/nixpkgs/pull/322964 in master ## Touchpad - [x] Working, including 'disable while typing' usable quirk + - [x] Working, including 'disable while typing' usable quirk ## Thunderbolt - [x] Working + - [x] Working ## NVME - [x] Working, older NVME / Controller may need workaround for resume + - [x] Working, older NVME / Controller may need workaround for resume ## Suspend/Resume - [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). + - [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). ## Wifi - [x] Working (2,4Ghz & 5Ghz supported), WEP3 currently broken b/c old brcm fw + - [x] Working (2,4Ghz & 5Ghz supported), WEP3 broken -> brcm fw blob (2015) ## Resources - https://github.com/Dunedan/mbp-2016-linux?tab=readme-ov-file diff --git a/apple/macbook-pro/14-1/btfix.sh b/apple/macbook-pro/14-1/btfix.sh deleted file mode 100755 index f555bba..0000000 --- a/apple/macbook-pro/14-1/btfix.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -## -# For some reason /dev/ttyS0 is created, and then removed by udev. We need this -# for bluetooth, and the only way to get it again is to reload 8502_dw. Do so. -## - - -## -# /sys/devices/pci0000:00/0000:00:1e.0/driver -> intel-lpss -# /sys/bus/pci/devices/0000:00:1e.0 -# /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:8a/BCM2E7C:00 -## - -# udevadm info --query=all --path=/sys/bus/serial/devices/serial0-0 -# P: /devices/pci0000:00/0000:00:1e.0/dw-apb-uart.2/serial0/serial0-0 -# M: serial0-0 -# R: 0 -# U: serial -# E: DEVPATH=/devices/pci0000:00/0000:00:1e.0/dw-apb-uart.2/serial0/serial0-0 -# E: SUBSYSTEM=serial -# E: MODALIAS=acpi:BCM2E7C:APPLE-UART-BLTH: -# E: USEC_INITIALIZED=12406199 -# E: PATH=/nix/store/56jhf2k9q31gwvhjxmm2akkkhi4a8nz1-udev-path/bin:/nix/store/56jhf2k9q31gwvhjxmm2akkkhi4a8nz1-udev-path/sbin -# E: ID_VENDOR_FROM_DATABASE=Broadcom - - -if [[ ! -e "/sys/devices/pci0000:00/0000:00:1e.0/dw-apb-uart.2/tty/ttyS0" ]]; then - if [[ -e /sys/module/8250_dw ]]; then - rmmod 8250_dw - fi - - modprobe 8250_dw -fi - -exec btattach --protocol=h4 --bredr=/dev/ttyS0 --speed=3000000 diff --git a/apple/macbook-pro/14-1/default.nix b/apple/macbook-pro/14-1/default.nix index c2b61f9..02c8542 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -5,10 +5,10 @@ ... }: { imports = [ + ../. ../../../common/gpu/intel/kaby-lake ../../../common/gpu/intel ../../../common/hidpi.nix - ../../../common/pc/laptop ../../../common/pc/laptop/ssd ../../../common/pc/laptop/acpi_call.nix ]; @@ -49,34 +49,10 @@ cpu.intel.updateMicrocode = lib.mkDefault true; }; - # Bluetooth, only needed if kernel lacks support - custom kernel build - # boot.kernelPatches = [ - # { - # name = "bcrm-config"; - # patch = null; - # extraConfig = '' - # BT_HCIUART_BCM y ''; - # } - # ]; - - ## [Workaround seems not to work anymore! Any Ideas?] - # For some reason /dev/ttyS0 is created, and then removed by udev. We need this - # for bluetooth, and the only way to get it again is to reload 8502_dw. Luckily, - # nothing else uses it. - ## - # systemd.services.btattach-bcm2e7c = lib.mkIf config.hardware.bluetooth.enable { - # before = [ "bluetooth.target" ]; - # after = [ "sys-devices-platform-serial8250-tty-ttyS1.device" ]; - # path = [ pkgs.bash pkgs.kmod pkgs.bluez ]; - # serviceConfig.Type = "simple"; - # serviceConfig.ExecStart = "${./btfix.sh}"; - # wantedBy = [ "multi-user.target" ]; - # }; - - ## [Enable only if needed!] + # [Enable only if needed!] # Disable d3cold on older NVME controller, only if needed # https://github.com/Dunedan/mbp-2016-linux - ## + # #systemd.services.disable-nvme-d3cold = { # description = "Disables d3cold on the NVME controller"; # before = [ "suspend.target" ]; diff --git a/flake.nix b/flake.nix index 7bbbe12..caa4a71 100644 --- a/flake.nix +++ b/flake.nix @@ -17,6 +17,7 @@ apple-macbook-pro-12-1 = import ./apple/macbook-pro/12-1; apple-macbook-pro-14-1 = import ./apple/macbook-pro/14-1; apple-macmini-4-1 = import ./apple/macmini/4; + apple-imac-18-2 = import ./apple/imac/18-2; apple-t2 = import ./apple/t2; asus-battery = import ./asus/battery.nix; asus-ally-rc71l = import ./asus/ally/rc71l;