fix(nix): fix linking to RocksDB

This commit is contained in:
Henry-Hiles authored and Ellis Git committed 2026-11-09 18:03:34 +00:00
1 parent 779374bb54
commit bf028274f8
1 file changed
+6 -13
+6 -13
View File
@@ -42,7 +42,12 @@ let
env = {
CARGO_PROFILE = profile;
RUSTFLAGS = rustflags;
# Rust links with its bundled rust-lld by default on linux-gnu targets.
# This bypasses nixpkgs' linker wrapper (and its rpaths), so we make it use the system one.
# `-C linker-features=-lld` is only stable on x86_64, but cc takes the last `-fuse-ld`.
RUSTFLAGS = lib.concatStringsSep " " (
lib.optional stdenv.hostPlatform.isLinux "-C link-arg=-fuse-ld=bfd" ++ [ rustflags ]
);
GIT_COMMIT_HASH = self.rev or self.dirtyRev or "";
GIT_COMMIT_HASH_SHORT = self.shortRev or self.dirtyShortRev or "";
}
@@ -60,18 +65,6 @@ craneLib.buildPackage (
inherit cargoExtraArgs;
cargoArtifacts = craneLib.buildDepsOnly attrs;
# Needed to make continuwuity link to rocksdb
postFixup = lib.optionalString (stdenv.hostPlatform.isLinux && rocksdb != null) ''
old_rpath="$(patchelf --print-rpath $out/bin/conduwuit)"
extra_rpath="${
lib.makeLibraryPath [
rocksdb
]
}"
patchelf --set-rpath "$old_rpath:$extra_rpath" $out/bin/conduwuit
'';
meta = {
description = "A community-driven Matrix homeserver in Rust";
mainProgram = "conduwuit";