From 39a2b0a97ef8b8a3df88f49971dbf21551900467 Mon Sep 17 00:00:00 2001 From: Drewry Pope Date: Mon, 26 Oct 2026 23:58:33 -0500 Subject: [PATCH] feat(nixos): prefer IPv4 in getaddrinfo on amd (workaround for #1280) --- nixos/hosts/amd-ipv4-preference.nix | 23 +++++++++++++++++++++++ nixos/hosts/default.nix | 1 + 2 files changed, 24 insertions(+) create mode 100644 nixos/hosts/amd-ipv4-preference.nix diff --git a/nixos/hosts/amd-ipv4-preference.nix b/nixos/hosts/amd-ipv4-preference.nix new file mode 100644 index 0000000000..b8182c337a --- /dev/null +++ b/nixos/hosts/amd-ipv4-preference.nix @@ -0,0 +1,23 @@ +_: +{ + # Temporary workaround for the home IPv6 uplink stalling on payload + # transfers (developing-today/code#1280): prefer IPv4 in getaddrinfo + # result sorting until the home IPv6 path is repaired. Remove with + # the issue. + networking.getaddrinfo = { + label = { + "::1/128" = 0; + "::/0" = 1; + "2002::/16" = 2; + "::/96" = 3; + "::ffff:0:0/96" = 4; + }; + precedence = { + "::1/128" = 50; + "::/0" = 40; + "2002::/16" = 30; + "::/96" = 20; + "::ffff:0:0/96" = 100; + }; + }; +} diff --git a/nixos/hosts/default.nix b/nixos/hosts/default.nix index 96c0736a84..17f86af539 100644 --- a/nixos/hosts/default.nix +++ b/nixos/hosts/default.nix @@ -57,6 +57,7 @@ in # KRdp remote desktop for this laptop (user service + package); # see the file for the one-time on-machine credential setup. ./amd-krdp.nix + ./amd-ipv4-preference.nix ]; }; # amd-server = host {