From b31a7511e10977624a48829c6508060dcaee191a Mon Sep 17 00:00:00 2001 From: noe Date: Wed, 26 Jun 2024 18:12:25 -0400 Subject: [PATCH] nix: docker static link --- flake.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flake.nix b/flake.nix index 6b2d70f..cc7857f 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,13 @@ name = "plapkit"; src = ./.; vendorHash = "sha256-YY7Hj7lSq7vEoMEIu/zmweWzd7p7KF+4YCUX2SJ7kwI="; + + nativeBuildInputs = [pkgs.musl]; + ldflags = [ + # "-s -w" + "-linkmode external" + "-extldflags '-static -L${pkgs.musl}/lib'" + ]; }; packages.container = pkgs.dockerTools.buildImage {