Build release as a static binary
This commit is contained in:
parent
5fa89593ae
commit
ce80c5e23b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
.cargo
|
.cargo
|
||||||
|
/result
|
||||||
|
11
flake.nix
11
flake.nix
@ -25,10 +25,17 @@
|
|||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
defaultPackage = naersk-lib.buildPackage ./.;
|
defaultPackage = naersk-lib.buildPackage {
|
||||||
devShell = with pkgs; mkShell {
|
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 = [
|
nativeBuildInputs = [
|
||||||
toolchain
|
toolchain
|
||||||
|
pkgs.glibc.static
|
||||||
];
|
];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
source $(pwd)/.env.dev
|
source $(pwd)/.env.dev
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "nightly-2023-05-08"
|
channel = "nightly-2023-05-08"
|
||||||
components = [ "rustfmt", "rustc-dev", "clippy", "cargo" ]
|
components = [ "rustfmt", "rustc-dev", "clippy", "cargo" ]
|
||||||
|
targets = [ "x86_64-unknown-linux-musl" ]
|
||||||
|
Loading…
Reference in New Issue
Block a user