summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgs/tools/package-management/nix/default.nix12
-rw-r--r--pkgs/top-level/static.nix2
2 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 518c1baad5ad..8e35c6296ecd 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -17,8 +17,8 @@ common =
, stateDir
, confDir
, withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp
- , withAWS ? stdenv.isLinux || stdenv.isDarwin, aws-sdk-cpp
-
+ , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp
+ , enableStatic ? false
, name, suffix ? "", src, includesPerl ? false, fromGit ? false
}:
@@ -56,13 +56,15 @@ common =
propagatedBuildInputs = [ boehmgc ];
- # Seems to be required when using std::atomic with 64-bit types
- NIX_LDFLAGS = lib.optionalString (stdenv.hostPlatform.system == "armv6l-linux") "-latomic";
+ NIX_LDFLAGS =
+ lib.optionalString enableStatic "-lssl -lbrotlicommon -lssh2 -lz -lnghttp2 -lcrypto"
+ # Seems to be required when using std::atomic with 64-bit types
+ + lib.optionalString (stdenv.hostPlatform.system == "armv6l-linux") "-latomic";
preConfigure =
# Copy libboost_context so we don't get all of Boost in our closure.
# https://github.com/NixOS/nixpkgs/issues/45462
- if is20 then ''
+ if is20 && !enableStatic then ''
mkdir -p $out/lib
cp -pd ${boost}/lib/{libboost_context*,libboost_thread*,libboost_system*} $out/lib
rm -f $out/lib/*.a
diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix
index cc773207c374..670e0e5057bf 100644
--- a/pkgs/top-level/static.nix
+++ b/pkgs/top-level/static.nix
@@ -119,7 +119,7 @@ in {
static = true;
};
openblas = super.openblas.override { enableStatic = true; };
- nix = super.nix.override { withAWS = false; };
+ nix = super.nix.override { enableStatic = true; };
# openssl 1.1 doesn't compile
openssl = super.openssl_1_0_2.override {
static = true;