From c82af241f58d7aeaecbb2a6d17bd8d7bfcc834ce Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Wed, 20 Aug 2025 18:29:39 +0200 Subject: [PATCH] packaging: fix static build Normally `pkgsStatic` adds ` -static` to `NIX_CFLAGS_COMPILE`. Due to a bug this did not apply with `__structuredAttrs`. As the fix [1] has not been backported yet, put it in the package manually. [1] https://github.com/NixOS/nixpkgs/pull/428430 Fixes: https://git.lix.systems/lix-project/lix/issues/962 Change-Id: I6a6a6964c6a33f486ba3df3be16f715ad1b060c3 --- package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.nix b/package.nix index c537b2701..e5ecd6ff8 100644 --- a/package.nix +++ b/package.nix @@ -386,6 +386,9 @@ stdenv.mkDerivation (finalAttrs: { } // lib.optionalAttrs hostPlatform.isLinux { BUILD_TEST_SHELL = "${pkgsStatic.busybox}/bin"; + } + // lib.optionalAttrs hostPlatform.isStatic { + NIX_CFLAGS_COMPILE = " -static"; }; cargoDeps = rustPlatform.importCargoLock { lockFile = ./Cargo.lock; };