fix: make nix flake and cargo config portable across Linux and macOS

musl tooling is Linux-only, so guard it behind an isLinux check in
flake.nix and remove the hardcoded musl build target from .cargo/config.toml
(the nix devShell already sets CARGO_BUILD_TARGET on Linux).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Edward Langley
2026-03-30 22:22:11 -07:00
parent a655078997
commit e3078ba61d
2 changed files with 32 additions and 23 deletions

View File

@ -1,8 +1,6 @@
[build]
# Always build a fully-static musl binary by default.
# The devShell sets CARGO_BUILD_TARGET and CARGO_TARGET_*_LINKER,
# so the linker is resolved automatically via the environment.
target = "x86_64-unknown-linux-musl"
# The nix devShell sets CARGO_BUILD_TARGET=x86_64-unknown-linux-musl
# and the matching linker env vars, so no [build] target is needed here.
# This keeps the config portable across Linux and macOS.
[target.x86_64-unknown-linux-gnu]
# Use gcc (not rust-lld) for host-target build scripts on NixOS.