CGO_ENABLED='1' starting go 1.25

Around the time of go 1.20 I saw an announcement that CGO_ENABLED='0' was no longer necessary, so I’ve migrated my flakes to use mkShellNoCC. I updated today to latest unstable (using default pkgs.go which resolves now to 1.25) and my go builds started failing. I noticed that nixpkgs reverted to set CGO_ENABLED='1'. Does anybody know if this is intentional and the reasoning behind it? Here is a sample of what I’m seeing:

> nix run nixpkgs/nixos-23.11#go_1_19 env | grep CGO_ENABLED
CGO_ENABLED="1"

> nix run nixpkgs/nixos-23.11#go_1_20 env | grep CGO_ENABLED
CGO_ENABLED="0"

> nix run nixpkgs/nixos-24.05#go_1_21 env | grep CGO_ENABLED
CGO_ENABLED='0'

> nix run nixpkgs/nixos-24.11#go_1_22 env | grep CGO_ENABLED
CGO_ENABLED='0'

> nix run nixpkgs/nixos-24.11#go_1_23 env | grep CGO_ENABLED
CGO_ENABLED='0'

> nix run nixpkgs/nixos-24.11#go_1_24 env | grep CGO_ENABLED
CGO_ENABLED='0'

> nix run nixpkgs/master#go_1_24 env | grep CGO_ENABLED
CGO_ENABLED='0'

# and finally for 1.25
> nix run nixpkgs/master#go_1_25 env | grep CGO_ENABLED
CGO_ENABLED='1'

# goes as far back as 25.05
> nix run nixpkgs/nixos-25.05#go_1_25 env | grep CGO_ENABLED
CGO_ENABLED='1'

Are you on MacOS?​​​​​

I’m not, this is on NixOS (my system is running 25.11 already). I could try MacOS if required.

Here is the original announcement from the golang release notes: Go 1.20 Release Notes - The Go Programming Language . I don’t see anything in the 1.25 release notes that changes this behavior. So, something within nix could be happening.