Notes
My computer broke without me doing anything.
It sounds like something an engineer should never say, but my computer (environment) broke without me doing anything.
Nix
I use a package management system called Nix to set up my PC environment. I'll leave the passionate explanations of why Nix is great to others on the internet, but in the past few weeks, my Nix-managed environment broke. To be precise, package updates stopped working.
I said Nix, but since I'm on macOS, the exact stack is:
In this environment, running sudo darwin-rebuild switch --flake started failing a few weeks ago with this error.
1$ sudo darwin-rebuild switch --flake .#private-aarch64-256GB2building the system configuration...3error:4… while calling the 'derivationStrict' builtin5at <nix/derivation-internal.nix>:37:12:636|737| strict = derivationStrict drvAttrs;8| ^938|1011… while evaluating derivation 'darwin-system-25.11.44a7d0e'12whose name attribute is located at /nix/store/s7ga48spdagfm0j1rd740q52ih159g51-source/pkgs/stdenv/generic/make-derivation.nix:480:131314… while evaluating attribute 'activationScript' of derivation 'darwin-system-25.11.44a7d0e'15at /nix/store/a0qmksyiqyh60nda6fw7y1bzdv8w8vz2-source/modules/system/default.nix:89:7:1688|1789| activationScript = cfg.activationScripts.script.text;18| ^1990|2021… while evaluating the option `system.activationScripts.script.text':2223… while evaluating definitions from `/nix/store/a0qmksyiqyh60nda6fw7y1bzdv8w8vz2-source/modules/system/activation-scripts.nix':2425… while evaluating the option `system.activationScripts.applications.text':2627… while evaluating definitions from `/nix/store/a0qmksyiqyh60nda6fw7y1bzdv8w8vz2-source/modules/system/applications.nix':2829(stack trace truncated; use '--show-trace' to show the full, detailed trace)3031error: Package 'glibc-nolibgcc-2.40-66' in /nix/store/s7ga48spdagfm0j1rd740q52ih159g51-source/pkgs/development/libraries/glibc/default.nix:217 is not available on the requested hostPlatform:32hostPlatform.config = "arm64-apple-darwin"33package.meta.platforms = [34"aarch64-linux"35"armv5tel-linux"36"armv6l-linux"37"armv7a-linux"38"armv7l-linux"39"i686-linux"40"loongarch64-linux"41"m68k-linux"42"microblaze-linux"43"microblazeel-linux"44"mips-linux"45"mips64-linux"46"mips64el-linux"47"mipsel-linux"48"powerpc64-linux"49"powerpc64le-linux"50"riscv32-linux"51"riscv64-linux"52"s390-linux"53"s390x-linux"54"x86_64-linux"55]56package.meta.badPlatforms = [ ]57, refusing to evaluate.5859a) To temporarily allow packages that are unsupported for this system, you can use an environment variable60for a single invocation of the nix tools.6162$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=16364Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,65then pass `--impure` in order to allow use of environment variables.6667b) For `nixos-rebuild` you can set68{ nixpkgs.config.allowUnsupportedSystem = true; }69in configuration.nix to override this.7071c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add72{ allowUnsupportedSystem = true; }73to ~/.config/nixpkgs/config.nix.
Because of this, I can no longer install or update applications.
As the error message indicates, the environment is currently recognized as arm64-apple-darwin.
This was about to affect my work, so I investigated and found relevant GitHub issues. It looks like it may take time to resolve.
System name change
It seems the root cause was a PR in NixOS/nixpkgs: lib/systems: use Darwin architecture names for config and uname by emilazy · Pull Request #393213 · NixOS/nixpkgs.
Previously, ARM 64-bit macOS (Apple Silicon) was treated as aarch64-apple-darwin,
but this PR changed it to arm64-apple-darwin.
This change itself is to align with LLVM 20 changes, so the biggest culprit is LLVM.
I hadn't been conscious of the naming differences between AArch64 and arm64, but in the LLVM context, as LLVM backend differences between aarch64 and arm64 - Embedded person explains, AArch64 is created by ARM, while ARM64 is created by Apple. That article mentions a move to unify on AArch64, but perhaps time passed and they diverged again.
Indeed, running uname -m locally shows arm64.
1$ uname -m2arm64
This mismatch is likely what they wanted to resolve, but it caused packages to fail to build.
- scummvm: fix aarch64-darwin ranlib path by niklaskorz · Pull Request #407897 · NixOS/nixpkgs
- bug: Firefox refusing to build on standalone MacOS setup · Issue #6878 · nix-community/home-manager
- Nix standalone on MacOS's system string is
arm64-apple-darwinand notaarch64-darwin· Issue #401364 · NixOS/nixpkgs - copilot-language-server-fhs: Can't build on darwin · Issue #408666 · NixOS/nixpkgs
Looking at these PRs and issues, packages that hard-coded architecture strings instead of using stdenv.hostPlatform.config,
or packages using stdenv.hostPlatform.darwinArch, seem to be affected.
Solution
Cause found: I had installed copilot-language-server. This matches the issue below.
Since I manage Emacs packages with Nix, copilot-language-server was pulled in along with copilot.el. Temporarily removing copilot.el resolved the issue.