fix(nix): resolve missing libssl.so.3 when running via nix run

- Add autoPatchelfHook to patch RPATH in the output binary so it can
  find libssl and libcrypto at runtime
- Add stdenv.cc.cc.lib to buildInputs to satisfy libgcc_s.so.1
  dependency during auto-patchelf
- Move LD_LIBRARY_PATH from devShell to the package so test binaries
  can find libssl during checkPhase (before patchelf runs)
This commit is contained in:
Jon Seager 2026-02-06 19:23:02 +00:00
parent 5959f625b5
commit 5033c7b2f6
No known key found for this signature in database

View file

@ -51,6 +51,7 @@
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
autoPatchelfHook
clang clang
lld lld
pkg-config pkg-config
@ -59,6 +60,7 @@
buildInputs = with pkgs; [ buildInputs = with pkgs; [
openssl openssl
stdenv.cc.cc.lib
]; ];
env.LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.openssl ]; env.LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.openssl ];
@ -106,7 +108,6 @@
NIX_CONFIG = "experimental-features = nix-command flakes"; NIX_CONFIG = "experimental-features = nix-command flakes";
RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library"; RUST_SRC_PATH = "${rust}/lib/rustlib/src/rust/library";
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ openssl ];
buildInputs = [ buildInputs = [
rust rust