hyprutils/nix/default.nix

50 lines
944 B
Nix
Raw Normal View History

2024-06-08 23:13:58 +02:00
{
lib,
stdenv,
stdenvAdapters,
2024-06-08 23:13:58 +02:00
cmake,
2024-06-19 08:12:49 +02:00
pkg-config,
pixman,
2024-06-08 23:13:58 +02:00
version ? "git",
doCheck ? false,
debug ? false,
}: let
inherit (builtins) foldl';
inherit (lib.lists) flatten;
2024-06-08 23:13:58 +02:00
adapters = flatten [
stdenvAdapters.useMoldLinker
(lib.optional debug stdenvAdapters.keepDebugInfo)
2024-06-19 08:12:49 +02:00
];
customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
in
customStdenv.mkDerivation {
pname = "hyprutils";
inherit version doCheck;
src = ../.;
nativeBuildInputs = [
cmake
pkg-config
];
2024-06-08 23:13:58 +02:00
buildInputs = [
pixman
];
2024-06-08 23:13:58 +02:00
outputs = ["out" "dev"];
2024-06-17 12:05:21 +02:00
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
2024-06-17 12:05:21 +02:00
meta = with lib; {
homepage = "https://github.com/hyprwm/hyprutils";
description = "Small C++ library for utilities used across the Hypr* ecosystem";
license = licenses.bsd3;
platforms = platforms.linux;
};
}