nix: build with the mold linker on x86_64-linux

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I5d1e28f9b74fe1a4881a7105722ef3376a6a6964
This commit is contained in:
raf 2025-10-23 15:57:07 +03:00
commit 7a4f6378e9
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

View file

@ -1,6 +1,8 @@
{ {
lib, lib,
craneLib, craneLib,
stdenv,
mold,
versionCheckHook, versionCheckHook,
}: let }: let
pname = "stash"; pname = "stash";
@ -52,6 +54,11 @@ in
done done
''; '';
env = lib.optionalAttrs (stdenv.isLinux && !stdenv.hostPlatform.isAarch) {
CARGO_LINKER = "clang";
CARGO_RUSTFLAGS = "-Clink-arg=-fuse-ld=${mold}/bin/mold";
};
meta = { meta = {
description = "Wayland clipboard manager with fast persistent history and multi-media support"; description = "Wayland clipboard manager with fast persistent history and multi-media support";
homepage = "https://github.com/notashelf/stash"; homepage = "https://github.com/notashelf/stash";