nix: make mold optional

This commit is contained in:
Mihai Fufezan 2025-08-22 10:49:22 +03:00
parent 50637ed23e
commit adb34ed5e3
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg

View file

@ -22,12 +22,15 @@
version ? "git", version ? "git",
doCheck ? false, doCheck ? false,
debug ? false, debug ? false,
# whether to use the mold linker
# disable this for older machines without SSE4_2 and AVX2 support
withMold ? true,
}: let }: let
inherit (builtins) foldl'; inherit (builtins) foldl';
inherit (lib.lists) flatten; inherit (lib.lists) flatten;
adapters = flatten [ adapters = flatten [
stdenvAdapters.useMoldLinker (lib.optional withMold stdenvAdapters.useMoldLinker)
(lib.optional debug stdenvAdapters.keepDebugInfo) (lib.optional debug stdenvAdapters.keepDebugInfo)
]; ];
@ -52,7 +55,7 @@ in
buildInputs = [ buildInputs = [
hwdata hwdata
hyprutils (hyprutils.override {inherit withMold;})
libdisplay-info libdisplay-info
libdrm libdrm
libffi libffi