Logo

dev-resources.site

for different kinds of informations.

Day 3: Fighting with network interfaces

Published at
5/11/2023
Categories
nixos
apple
firmware
Author
raymondgh
Categories
3 categories in total
nixos
open
apple
open
firmware
open
Author
9 person written this
raymondgh
open
Day 3: Fighting with network interfaces

I went down quite a rabbit hole trying to figure out hardware compatibility on my own. I'll walk through how I worked on the Wi-Fi issue here. Most of this content will be useless because I ended up with another solution, but I'll describe it anyway. To begin, I asked ChatGPT what I should do. ChatGPT apparently knows a lot about NixOS, though not the latest information unfortunately. So if any of the steps taken here seem unintuitive, don't worry. I had guidance and you can too.

From the top, we know that if we want to use Network Manager as the primary way of managing internet (I do), then it needs access to the wifi interface. To see my interfaces, I ran this command:

 ip link show
Enter fullscreen mode Exit fullscreen mode

To see your available interfaces. I only had two results, lo and enp7s0u2. The lo will be there for everyone, and a variation of the enp* will represent an available ethernet interface. With working wireless, another entry should appear. Its absence means something is wrong. From here, I checked to see if my wireless network controller could even be found in the first place. To do this I added a new package, pciutils (PCI Utilities) to check the devices attached to my PCI slots (connections to the motherboard).

Adding it made my environment.systemPackages look like this:

  environment.systemPackages = with pkgs; [
    (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        bbenoist.nix
      ];
    })
    pciutils
  ];
Enter fullscreen mode Exit fullscreen mode

You can see the vscode w/ extensions from before, and now pciutils is there too.

I then ran the simple command

lspci | grep -i broadcom
Enter fullscreen mode Exit fullscreen mode

And good news, it exists! 03:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4364 802.11ac Wireless Network Adapter (rev 03) The mystery remained though, why if we could find the device we couldn't use it. Or might you say drive it? We need drivers!

There were more commands to investigate, such as

lsmod | grep -i brcmfmac
Enter fullscreen mode Exit fullscreen mode

To help check if there were conflicting drivers. I had a hard time interpreting the results, but ChatGPT said there was a conflict. I continued with this pair-debugging plan and ran more commands and did and undid a bunch of things. There are many versions of the Broadcom chip and the BCM4364 version in my MacbookPro15,1 is just one of many. I tried pretty hard to get this installed. Here are a bunch of things I tried/learned:

  • Added wl to boot.kernelModules
  • Enabled hardware.enableAllFirmware = true flag in hardware-configuration.nix
  • Added linuxKernel.packages.linux_zen.broadcom_sta to my system packages in configuration.nix
  • Blacklisted the apparently undesirable conflicting module with boot.blacklistedKernelModules = [ "brcmfmac" ];
  • Explicitly added linux 5.5 packages
  • Found that the popularly recommended site, aunali1, was offline, no longer offering broadcome drivers
  • Found that my BCM4364 is codenamed Midway and the others of the same generation are named after pacific/Hawaiian islands

Finally, I found https://t2linux.org/

Apple started introducing the T2 security chip in 2017 and my laptop has it. All new devices have it or something that has the same effect: Makes it super hard to use the laptop hardware.

Unfortunately following this guide was very difficult for me. Some of the instructions don't quite make sense and others don't have the expected result. It seems like doing something out of order or having done something differently ahead of following these steps can prevent success with this method.

I found myself in a state where there was something going on with the startup manager and I couldn't boot from other partitions or USB devices at all. I tried so many things. Really. And I hate to admit defeat, but this time I am doing just that. I resorted to resetting my Macbook to factory defaults, completely wiping it. I will try again fresh and be very careful about the steps I take.

nixos Article's
30 articles in total
Favicon
How to Set Up Kanata on NixOS: A Step-by-Step Guide
Favicon
NixOS - A Unique Linux Distribution
Favicon
NixOS Full Disk Encryption with USB/SD-Card/Password Unlock
Favicon
Choosing my distro: Ubuntu, NixOS, Elementary OS or Pop!_OS
Favicon
Nix first steps
Favicon
OpenResty on NixOS for an API Gateway
Favicon
Why Consider NixOS for Your Environment?
Favicon
Managing NixOS on DigitalOcean with Colmena
Favicon
I Changed My Mind - NixOS is NOT the Best Linux
Favicon
Backup GitHub Repositories with gidek
Favicon
Packing Custom Fonts for NixOS
Favicon
Managing NixOS Secrets via SOPS, sops-nix and opsops
Favicon
Running NixOS Guests on QEMU
Favicon
Archiving PostgreSQL Backups on NixOS
Favicon
The Ultimate NixOS Homelab Guide - Flakes, Modules and Fail2Ban w/ Cloudflare
Favicon
The radical concept of NixOS and why I love it!
Favicon
The Ultimate NixOS Homelab Guide - The Install
Favicon
The One Man Stack
Favicon
I use NixOS for my home-server, and you should too!
Favicon
This distro finally fixes Linux
Favicon
Running a Terraria Dedicated Server on NixOS
Favicon
NixOS on Raspberry Pi 4 with Encrypted Filesystem
Favicon
Day 7: Uninstalling NixOS from my Macbook Pro
Favicon
Nixpkgs: A community-maintained package lock file for all of Unix
Favicon
Writing a (Nix-Friendly) Hello World Web App in Haskell with Scotty
Favicon
Kick the Mix-ups to the Curb: Nix the Tricks and Juggle Go Projects like a Pro
Favicon
Day 6: Making rEFInd Look Good
Favicon
Day 5: NixOS & Git - version control for config.nix
Favicon
Day 4: (Re)Installing NixOS on my Macbook Pro
Favicon
Day 3: Fighting with network interfaces

Featured ones: