From 86f7198cb4ef6d9076e89bfc6c7f4c7f5cc9f8ee Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 17 Mar 2023 17:45:41 +0100 Subject: [PATCH] statically link nix binary --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 9c402bc..49ef08f 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,13 @@ let packageSet = pkgs.rustBuilder.makePackageSet ({ inherit packageFun rustVersion; + + # Config to build static binaries + target = "x86_64-unknown-linux-musl"; + codegenOpts = { + "x86_64-unknown-linux-musl" = + [ "target-feature=+crt-static" "link-arg=-static-pie" ]; + }; } // args); in packageSet.workspace.wgautomesh {