summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/servers/http/lwan/default.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkgs/servers/http/lwan/default.nix b/pkgs/servers/http/lwan/default.nix
index 7d6d34a6d2d..71f45028c31 100644
--- a/pkgs/servers/http/lwan/default.nix
+++ b/pkgs/servers/http/lwan/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, jemalloc }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, cmake, enableJemalloc ? !stdenv.hostPlatform.isMusl, jemalloc }:
 
 stdenv.mkDerivation rec {
   pname = "lwan";
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkg-config ];
 
-  buildInputs = [ jemalloc zlib ];
+  buildInputs = [ zlib ] ++ lib.optional enableJemalloc jemalloc;
 
   # Note: tcmalloc and mimalloc are also supported (and normal malloc)
-  cmakeFlags = [ "-DUSE_ALTERNATIVE_MALLOC=jemalloc" ];
+  cmakeFlags = lib.optional enableJemalloc "-DUSE_ALTERNATIVE_MALLOC=jemalloc";
 
   meta = with lib; {
     description = "Lightweight high-performance multi-threaded web server";