From 4bbc31f41b9a4f61c892a754551e98c5c4328a80 Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Sun, 13 Jul 2025 13:23:18 +0200 Subject: [PATCH] Build static binary --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake.nix b/flake.nix index 4f1c653..747a66b 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,16 @@ # And some build configuration. # See https://nixos.org/manual/nixpkgs/unstable/#haskell-packaging-helpers. [ + compose.disableSharedExecutables + compose.disableSharedLibraries + (compose.appendConfigureFlags [ + "--ghc-option=-optl=-static" + "--ghc-option=-optl=-pthread" + "--ghc-option=-optl=-L${pkgs.gmp6.override { withStatic = true; }}/lib" + "--ghc-option=-optl=-L${pkgs.zlib.static}/lib" + "--ghc-option=-optl=-L${pkgs.glibc.static}/lib" + "--extra-lib-dirs=${pkgs.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib" + ]) # Remove warp which pulls GHC into the runtime deps for some reason. (compose.overrideCabal (drv: { postInstall = ''