Build static binary

This commit is contained in:
Paul Brinkmeier 2025-07-13 13:23:18 +02:00
parent 3ff0dc79d5
commit 4bbc31f41b

View File

@ -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 = ''