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, lib,
stdenv, stdenv,
stdenvAdapters,
cmake, cmake,
hwdata, hwdata,
hyprutils, hyprutils,
@ -20,8 +21,19 @@
wayland-scanner, wayland-scanner,
version ? "git", version ? "git",
doCheck ? false, doCheck ? false,
}: debug ? false,
stdenv.mkDerivation { }: 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"; pname = "aquamarine";
inherit version doCheck; inherit version doCheck;
src = ../.; src = ../.;
@ -57,9 +69,10 @@ stdenv.mkDerivation {
outputs = ["out" "dev"]; outputs = ["out" "dev"];
cmakeBuildType = "RelWithDebInfo"; cmakeBuildType =
if debug
dontStrip = true; then "Debug"
else "RelWithDebInfo";
meta = { meta = {
homepage = "https://github.com/hyprwm/aquamarine"; homepage = "https://github.com/hyprwm/aquamarine";