From d3ef6d0c7c0525d9d306d47245ae761904a6211f Mon Sep 17 00:00:00 2001 From: "Paepcke, Michael" Date: Fri, 28 Jun 2024 20:05:46 +0200 Subject: [PATCH 1/8] apple-macbookpro-14-1: update info, simplify and fix config --- apple/macbook-pro/14-1/README.md | 8 +++---- apple/macbook-pro/14-1/btfix.sh | 38 ------------------------------ apple/macbook-pro/14-1/default.nix | 30 +++-------------------- 3 files changed, 7 insertions(+), 69 deletions(-) delete mode 100755 apple/macbook-pro/14-1/btfix.sh diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index 0a0e2df..d456ff2 100644 --- a/apple/macbook-pro/14-1/README.md +++ b/apple/macbook-pro/14-1/README.md @@ -1,10 +1,10 @@ -# 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, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 ## Bluetooth - [ ] Still broken, even (hacky) workaround does not work any more with latest driver updates + [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 ## Touchpad [x] Working, including 'disable while typing' usable quirk @@ -19,7 +19,7 @@ [ ] 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 54a6e84..e2dcb72 100644 --- a/apple/macbook-pro/14-1/default.nix +++ b/apple/macbook-pro/14-1/default.nix @@ -5,10 +5,10 @@ ... }: { imports = [ + ../. ../../../common/cpu/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" ]; From 40e296b2b3f6dc674191013c7583a67778228166 Mon Sep 17 00:00:00 2001 From: "Paepcke, Michael" Date: Fri, 28 Jun 2024 22:38:31 +0200 Subject: [PATCH 2/8] apple-imac-18-2: add imac, add imac-18-2 --- apple/imac/18-2/README.md | 26 ++++++++++++++++++++++++++ apple/imac/18-2/default.nix | 30 ++++++++++++++++++++++++++++++ apple/imac/default.nix | 8 ++++++++ 3 files changed, 64 insertions(+) create mode 100644 apple/imac/18-2/README.md create mode 100644 apple/imac/18-2/default.nix create mode 100644 apple/imac/default.nix diff --git a/apple/imac/18-2/README.md b/apple/imac/18-2/README.md new file mode 100644 index 0000000..6fdbb96 --- /dev/null +++ b/apple/imac/18-2/README.md @@ -0,0 +1,26 @@ +# iMac 18,2, NixOS 24.05 (2024) + +## Audio + [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 + +## Bluetooth + [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 + +## 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 + ]; +} From d33e3e71477521f50af926a3570527e9f2e37879 Mon Sep 17 00:00:00 2001 From: "Paepcke, Michael" Date: Fri, 28 Jun 2024 22:49:56 +0200 Subject: [PATCH 3/8] apple-imac-18-2: add flake support --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 159e2d1..e8472e4 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,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; From d403b7f6ae7e513f1c7384b1dca80074a991a7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 30 Jun 2024 09:29:16 +0200 Subject: [PATCH 4/8] apple/imac/18-2/README.md: use markdown checkboxes --- apple/imac/18-2/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apple/imac/18-2/README.md b/apple/imac/18-2/README.md index 6fdbb96..6548ec8 100644 --- a/apple/imac/18-2/README.md +++ b/apple/imac/18-2/README.md @@ -1,25 +1,25 @@ # iMac 18,2, NixOS 24.05 (2024) ## Audio - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 +- [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 ## Bluetooth - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 +- [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 ## Thunderbolt - [x] ok +- [x] ok ## SATA - [x] ok +- [x] ok ## NVME - [x] ok, older NVME / Controller may need workaround for resume +- [x] ok, older NVME / Controller may need workaround for resume ## Suspend/Resumer - [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). +- [ ] Thunderbolt, WIFI, NVME may still need reboot (sometimes). ## Wifi - [x] Working (2,4Ghz & 5Ghz supported), WEP3 broken -> brcm fw blob (2015) +- [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 From c6b440dcd63fdb65dbde486d41bf63ef228335b6 Mon Sep 17 00:00:00 2001 From: Michael Paepcke Date: Sun, 30 Jun 2024 08:14:43 +0000 Subject: [PATCH 5/8] apple/macbook-pro/14-1/README.md: use markdown checkboxes --- apple/macbook-pro/14-1/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index d456ff2..2809d90 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.05 (2024) ## Audio - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 + - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 ## Bluetooth - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 + - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 ## 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 broken -> brcm fw blob (2015) + - [x] Working (2,4Ghz & 5Ghz supported), WEP3 broken -> brcm fw blob (2015) ## Resources - https://github.com/Dunedan/mbp-2016-linux?tab=readme-ov-file From 6187754bdda54b330bfa46f383840221d2c5d9e4 Mon Sep 17 00:00:00 2001 From: Michael Paepcke Date: Mon, 15 Jul 2024 19:35:23 +0000 Subject: [PATCH 6/8] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- apple/macbook-pro/14-1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index 2809d90..216bb1d 100644 --- a/apple/macbook-pro/14-1/README.md +++ b/apple/macbook-pro/14-1/README.md @@ -4,7 +4,7 @@ - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 ## Bluetooth - - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 + - [ ] broken lands https://github.com/NixOS/nixpkgs/pull/322964 in master ## Touchpad - [x] Working, including 'disable while typing' usable quirk From ea9f6719b17ab3a13271ed1d1306b174b19f510b Mon Sep 17 00:00:00 2001 From: Michael Paepcke Date: Mon, 15 Jul 2024 19:35:33 +0000 Subject: [PATCH 7/8] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- apple/macbook-pro/14-1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/macbook-pro/14-1/README.md b/apple/macbook-pro/14-1/README.md index 216bb1d..ce74d7c 100644 --- a/apple/macbook-pro/14-1/README.md +++ b/apple/macbook-pro/14-1/README.md @@ -1,7 +1,7 @@ # MacBook Pro 14,1, NixOS 24.05 (2024) ## Audio - - [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 + - [ ] broken until https://github.com/NixOS/nixpkgs/pull/322968 lands in master ## Bluetooth - [ ] broken lands https://github.com/NixOS/nixpkgs/pull/322964 in master From 37d3f20674ad0d7ecc0367345ede6c550d1be819 Mon Sep 17 00:00:00 2001 From: Michael Paepcke Date: Mon, 15 Jul 2024 19:35:43 +0000 Subject: [PATCH 8/8] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jörg Thalheim --- apple/imac/18-2/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/imac/18-2/README.md b/apple/imac/18-2/README.md index 6548ec8..7ed259b 100644 --- a/apple/imac/18-2/README.md +++ b/apple/imac/18-2/README.md @@ -1,10 +1,10 @@ # iMac 18,2, NixOS 24.05 (2024) ## Audio -- [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322968 +- [ ] broken until https://github.com/NixOS/nixpkgs/pull/322968 lands in master ## Bluetooth -- [ ] broken, PR pending: https://github.com/NixOS/nixpkgs/pull/322964 +- [ ] broken until https://github.com/NixOS/nixpkgs/pull/322964 lands in master ## Thunderbolt - [x] ok