[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" [target.x86_64-unknown-linux-gnu] # Use gcc (not rust-lld) for host-target build scripts on NixOS. # rust-lld bundled with rust-overlay can't resolve glibc symbols on NixOS. linker = "gcc" [target.x86_64-unknown-linux-musl] # Linker is provided via CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER # in the nix devShell. Outside nix, musl-gcc must be in PATH. rustflags = ["-C", "target-feature=+crt-static"]