nix: add stdenvAdapters

This commit is contained in:
Mihai Fufezan 2024-11-05 08:48:06 +02:00
parent 8d732fa8af
commit a49bc3583f
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg

View file

@ -1,6 +1,7 @@
{
lib,
stdenv,
stdenvAdapters,
cmake,
hwdata,
hyprutils,
@ -20,8 +21,19 @@
wayland-scanner,
version ? "git",
doCheck ? false,
}:
stdenv.mkDerivation {
debug ? false,
}: let
inherit (builtins) foldl';
inherit (lib.lists) flatten;
adapters = flatten [
stdenvAdapters.useMoldLinker
(lib.optional debug stdenvAdapters.keepDebugInfo)
];
customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
in
customStdenv.mkDerivation {
pname = "aquamarine";
inherit version doCheck;
src = ../.;
@ -57,9 +69,10 @@ stdenv.mkDerivation {
outputs = ["out" "dev"];
cmakeBuildType = "RelWithDebInfo";
dontStrip = true;
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
meta = {
homepage = "https://github.com/hyprwm/aquamarine";