diff --git a/flake.nix b/flake.nix index 820e7b0..496f209 100644 --- a/flake.nix +++ b/flake.nix @@ -49,11 +49,15 @@ ]; }; pkgs = pkgsFor nixpkgs; + muslPkgs = pkgs.pkgsMusl; in { overlays.${system} = import ./nix/overlay.nix; - packages.${system}.default = pkgs.feedback; + packages.${system} = { + default = pkgs.feedback; + static = muslPkgs.feedback; + }; checks.${system} = { release = self.packages.${system}.default; shell = self.devShells.${system}.default; diff --git a/nix/overlay.nix b/nix/overlay.nix index 828dcf7..7e56080 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -19,7 +19,7 @@ with final.haskell.lib; (old: { doBenchmark = true; doHaddock = true; - doCoverage = false; + doCoverage = false; # No need because we use dekking doHoogle = true; doCheck = false; # Only in coverage report hyperlinkSource = false; @@ -39,7 +39,17 @@ with final.haskell.lib; "--ghc-options=-Wcpp-undef" "--ghc-options=-Werror" "--ghc-options=-optP-Wno-nonportable-include-path" # For macos + ] ++ optionals final.stdenv.hostPlatform.isMusl [ + "--ghc-option=-static" + "--ghc-option=-optl=-static" + # Static + "--extra-lib-dirs=${final.gmp6.override { withStatic = true; }}/lib" + "--extra-lib-dirs=${final.libffi.overrideAttrs (old: { dontDisableStatic = true; })}/lib" + # for -ltinfo + "--extra-lib-dirs=${(final.ncurses.override { enableStatic = true; })}/lib" ]; + enableSharedExecutables = !final.stdenv.hostPlatform.isMusl; + enableSharedLibraries = !final.stdenv.hostPlatform.isMusl; }))); feedback-test-harness = buildStrictly (overrideCabal (self.callPackage ../feedback-test-harness { }) (old: {