I’m trying to connect: PC with NixOS and TB4 <> certified TB cable <> Mac Mini. I followed instructions on the nixos wiki page, though the mac doesn’t show up with I do boltctl list. It’s very unstable, sometimes it works and I can access instances of copyparty webui running on either device, or it doesn’t work from or to either device when I try ping -c 3 IP-address. Sometimes it says in macOS settings that thunderbolt bridge is not connected.
The Mac not showing up in boltctl list is normal, host-to-host networking doesn’t go through bolt authorization, it just brings up a thunderbolt0 interface. The flakiness I’d bet is NetworkManager: it sees thunderbolt0 appear, tries DHCP, gives up and tears it down again. Give both ends a static IP (e.g. 10.0.0.1/30 on NixOS and 10.0.0.2/30 on the Mac’s Thunderbolt Bridge, no router), and either a fixed NM profile for thunderbolt0 or mark it unmanaged. Then the link should survive a replug.
In the config you posted NM is still managing thunderbolt0, so it keeps trying DHCP on top of your fixed IP and drops the link when that fails. I’d take it away from NM completely and let NixOS set the address:
On the Mac: Thunderbolt Bridge > Details > TCP/IP, Configure IPv4 Manually, 10.0.0.2, subnet 255.255.255.252, router empty. After the rebuild ip addr show thunderbolt0 should have the address right after you plug in. If it still drops, keep journalctl -f open while it happens and see what takes the interface down.
I had tried this, I set the IP address on the mac to 169.254.0.2 and added subnet 255.255.255.252 and router empty. Ping worked from mac to linux but not the other way.
I changed the prefixLength to 30 and rebuilt nixos, then the connection dropped altogether, I restarted but now I get the following:
ip -4 addr show dev thunderbolt0
Device "thunderbolt0" does not exist.
sudo dmesg | grep -i thunderbolt
[ 0.853993] ACPI: bus type thunderbolt registered
I can’t find any thunderbolt messages in journalctl -f.
Edit: I changed the length back to 16, added boot.kernelModules = [ "thunderbolt" "thunderbolt_net"];, rebuilt nixos, tried another certified TB4 cable, and rebooted, and there’s still no TB connection.
Edit 2: 2 hours later, I reseat the cable and the connection is made, however once again I can ping from mac to linux but not linux to mac.
I think that’s it. With a /30, 169.254.0.3 is the broadcast address, not a host, so the Mac treats your Linux side as broadcast and won’t answer it. Put .1 on NixOS and .2 on the Mac, both /30.
What difference does changing the address to 169.254.0.1 and 0.2 make?
I wrote the reply after setting the subnet mask on mac to 255.255.255.252 and setting prefix length on nixOS to 30, that’s when it wouldn’t connect at all.
I was thinking of having all the following addresses (with thunderbolt daisy chained), is this fine?
169.254.0.1 - my nixos laptop
169.254.0.2 - my mac mini
169.254.0.3 - my nixos desktop
I’m trying a prefix length of 16 on both nixos devices and a subnet mask of 255.255.0.0 on the mac. It’s still finnicky, one time the daisy chain worked but now it doesn’t, sometimes the laptop to mac connection or mac to desktop works, and sometimes they dont.
What difference does changing the address to 169.254.0.1 and 0.2 make?
It only mattered for the /30, with /16 it doesn’t. But I’d get off 169.254 completely. That range is link-local, macOS auto-assigns its own addresses there whenever it feels like it, and 169.254.0.x is even reserved in the RFC, so flaky like this is kind of expected. Give all three static addresses from a private range like 10.42.0.1, .2 and .3 /24, and on the Mac put it on the Thunderbolt Bridge interface, since that’s the thing joining the laptop and desktop ports in the chain.
I changed the mac IP to 10.0.0.2 and the subnet to 255.255.255.0.
The mac and laptop seemed to have work fine for the past day (including restarting and unplugging a bunch of times), but the desktop is still finnicky, it seems to work after I turn it on and plug it in after it finishes booting. It uses a, Asus ThunderboltEx 4 Card with a compatible board (Asus B650E Max Gaming Wifi W).
I finally figured everything out after a total of over a week of struggling and paranoia about getting Thunderbolt networking to work. It’s been a days but now I’m fairly confident I have it working, all devices can be hot-plugged repeatedly and still work reliably whenever its connected.
I had asked LLMs a bunch of times what to do about the finicky connection, they didn’t give helpful answers but I finally got one when I gave it my whole configuration. It gave me the systemd.network options below, I asked again for MTU, the max MTU on mac is 65,518. It’s reliable for me unlike networking.interfaces.thunderbolt0.ipv4.addresses.
My setup is: Thinkpad (TB4) <> Intel certified TB4 cable <> Anker Prime TB5 dock <> M4 Mac Mini (TB4) <> TB5 cable (came with the dock) <> Desktop with Asus ThunderboltEX 4 card.
The ThunderboltEX card had issues with hot-plugging, which went away after installing a card firmware update from here. The instructions said to launch an EFI shell with a flash drive containing the files, which didn’t work for me. I got a suggestion here to rename and move the .efi file to \EFI\Boot\bootx64.efi, and copy PDFW.bin and NVM.bin into the flash drive’s root directory and the EFI and Boot folders so the program doesn’t fail to find them. Then instead of launching an EFI shell from the BIOS, I select the flash drive from the boot menu.
For the Mac thunderbolt bridge, I set the ipv4 and ipv6 configuration to “manual” (and left ipv6 blank). I set the IP to 10.0.0.2, the subnet to 255.255.255.0, and left router to blank. Under “hardware”, I set MTU to the max 65,518.
Claude suggested enp0s20f0u?u3* below to ignore extra unneeded ethernet interfaces that appear after plugging in either device to the Mac.