diff --git a/.gitignore b/.gitignore index c8cc50d..fc5ecd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target .cargo +/result diff --git a/flake.nix b/flake.nix index 474b726..32a8b45 100644 --- a/flake.nix +++ b/flake.nix @@ -25,10 +25,17 @@ in { - defaultPackage = naersk-lib.buildPackage ./.; - devShell = with pkgs; mkShell { + defaultPackage = naersk-lib.buildPackage { + src = ./.; + doCheck = false; + nativeBuildInputs = [ pkgs.pkgsStatic.stdenv.cc ]; + CARGO_BUILD_TARGET = "x86_64-unknown-linux-musl"; + CARGO_BUILD_RUSTFLAGS = "-C target-feature=+crt-static"; + }; + devShell = pkgs.mkShell { nativeBuildInputs = [ toolchain + pkgs.glibc.static ]; shellHook = '' source $(pwd)/.env.dev diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ce8c107..4b25b8b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,4 @@ [toolchain] channel = "nightly-2023-05-08" components = [ "rustfmt", "rustc-dev", "clippy", "cargo" ] +targets = [ "x86_64-unknown-linux-musl" ]