mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
build(nix): use mold linker
This commit is contained in:
parent
5b901d9775
commit
8dba530131
18
flake.nix
18
flake.nix
@ -62,6 +62,14 @@
|
||||
mkdir $out
|
||||
ln -sf ${./assets} $out/assets
|
||||
'';
|
||||
|
||||
configMoldLinker = ''
|
||||
echo "
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
linker = "clang"
|
||||
rustflags = ["-C", "link-arg=-fuse-ld=${lib.getExe pkgs.mold}"]
|
||||
" >> $CARGO_HOME/config.toml
|
||||
'';
|
||||
in {
|
||||
veloren-common = oldAttrs: {
|
||||
# Disable `git-lfs` check here since we check it ourselves
|
||||
@ -71,6 +79,12 @@
|
||||
NIX_GIT_HASH = prettyRev;
|
||||
NIX_GIT_TAG = tag;
|
||||
};
|
||||
veloren-voxygen-deps = oldAttrs: {
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
};
|
||||
veloren-voxygen = oldAttrs: {
|
||||
inherit version;
|
||||
|
||||
@ -101,6 +115,10 @@
|
||||
"../../../assets/voxygen/audio/null.ogg" \
|
||||
"${./assets/voxygen/audio/null.ogg}"
|
||||
'';
|
||||
postConfigure = ''
|
||||
${oldAttrs.postConfigure or ""}
|
||||
${configMoldLinker}
|
||||
'';
|
||||
postInstall = ''
|
||||
${oldAttrs.postInstall or ""}
|
||||
if [ -f $out/bin/veloren-voxygen ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user