Skip to content

Commit 1601649

Browse files
committed
fix(nix): replace hardcoded target triple
1 parent 3635be0 commit 1601649

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flake.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-linux" ] (
2626
system:
2727
let
28+
targetTriple = builtins.replaceStrings [ "-linux" ] [ "-unknown-linux-musl" ] system;
2829
pkgs = import nixpkgs {
2930
inherit system;
3031
overlays = [
@@ -33,12 +34,13 @@
3334
];
3435
};
3536

37+
3638
# --- Libraries ---
3739
lib = pkgs.lib;
3840
craneLib = (crane.mkLib pkgs).overrideToolchain (
3941
toolchain:
4042
toolchain.rust-bin.nightly."2025-06-20".default.override {
41-
targets = [ "x86_64-unknown-linux-musl" ];
43+
targets = [ targetTriple ];
4244
extensions = [
4345
"clippy"
4446
"rust-analyzer"
@@ -90,7 +92,7 @@
9092
];
9193

9294
# Statically compile with MUSL for minimally sized binaries
93-
CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl";
95+
CARGO_BUILD_TARGET = targetTriple;
9496
CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static";
9597
};
9698

0 commit comments

Comments
 (0)