diff --git a/nix/default.nix b/nix/default.nix index 093cf00..ae1b1d4 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -7,7 +7,6 @@ gtest, pixman, version ? "git", - doCheck ? false, debug ? false, # whether to use the mold linker # disable this for older machines without SSE4_2 and AVX2 support @@ -15,9 +14,8 @@ }: let inherit (builtins) foldl'; - inherit (lib.attrsets) mapAttrsToList; inherit (lib.lists) flatten optional; - inherit (lib.strings) cmakeBool optionalString; + inherit (lib.strings) optionalString; adapters = flatten [ (lib.optional withMold stdenvAdapters.useMoldLinker) @@ -28,16 +26,18 @@ let in customStdenv.mkDerivation { pname = "hyprutils" + optionalString debug "-debug"; - inherit version doCheck; + inherit version; src = ../.; + doCheck = debug; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = flatten [ - (optional doCheck gtest) + (optional debug gtest) pixman ]; @@ -48,10 +48,6 @@ customStdenv.mkDerivation { cmakeBuildType = if debug then "Debug" else "RelWithDebInfo"; - cmakeFlags = mapAttrsToList cmakeBool { - "DISABLE_TESTING" = !doCheck; - }; - meta = with lib; { homepage = "https://github.com/hyprwm/hyprutils"; description = "Small C++ library for utilities used across the Hypr* ecosystem"; diff --git a/nix/overlays.nix b/nix/overlays.nix index dab9c03..937971b 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -18,6 +18,6 @@ in { inherit version; }; hyprutils-debug = final.hyprutils.override {debug = true;}; - hyprutils-with-tests = final.hyprutils.override {doCheck = true;}; + hyprutils-with-tests = final.hyprutils-debug; }; }