hyprutils/nix/default.nix

51 lines
1,016 B
Nix
Raw Normal View History

2024-06-09 00:13:58 +03:00
{
lib,
stdenv,
stdenvAdapters,
2024-06-09 00:13:58 +03:00
cmake,
2024-06-19 09:12:49 +03:00
pkg-config,
pixman,
2024-06-09 00:13:58 +03:00
version ? "git",
doCheck ? false,
debug ? false,
}: let
inherit (builtins) foldl';
inherit (lib.lists) flatten;
inherit (lib.strings) optionalString;
2024-06-09 00:13:58 +03:00
adapters = flatten [
stdenvAdapters.useMoldLinker
(lib.optional debug stdenvAdapters.keepDebugInfo)
2024-06-19 09:12:49 +03:00
];
customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
in
customStdenv.mkDerivation {
pname = "hyprutils" + optionalString debug "-debug";
inherit version doCheck;
src = ../.;
nativeBuildInputs = [
cmake
pkg-config
];
2024-06-09 00:13:58 +03:00
buildInputs = [
pixman
];
2024-06-09 00:13:58 +03:00
outputs = ["out" "dev"];
2024-06-17 13:05:21 +03:00
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
2024-06-17 13:05:21 +03: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;
};
}