From 7de3f276423fa50a25017021b473cbb5abd0194b Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 5 Aug 2024 02:04:23 +0300 Subject: [PATCH] nix: build with llvm.stdenv; use mold linker --- nix/package.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nix/package.nix b/nix/package.nix index f2c6e4f..1a7dde3 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,17 +1,21 @@ { lib, rustPlatform, + stdenvAdapters, + llvm, }: let toml = (lib.importTOML ../Cargo.toml).package; pname = toml.name; inherit (toml) version; in - rustPlatform.buildRustPackage { + rustPlatform.buildRustPackage.override {stdenv = stdenvAdapters.useMoldLinker llvm.stdenv;} { + RUSTFLAGS = "-C link-arg=-fuse-ld=mold"; + inherit pname version; src = builtins.path { name = "${pname}-${version}"; - path = ../.; + path = lib.sources.cleanSource ../.; }; cargoLock.lockFile = ../Cargo.lock;