From cc9fa47406449cab4bb9a79aa969e715f4d461e9 Mon Sep 17 00:00:00 2001 From: Andrea Bedini Date: Thu, 13 Jul 2023 17:45:06 +0800 Subject: [PATCH] Add clangStdenv --- default.nix | 21 ++++++++------------- flake.nix | 1 + 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/default.nix b/default.nix index 6a75bd5..2c41d21 100644 --- a/default.nix +++ b/default.nix @@ -1,36 +1,31 @@ { stdenv , lib , nix -, meson -, cmake -, ninja -, pkg-config -, boost -, nlohmann_json +, pkgs , srcDir ? null }: let - filterMesonBuild = dir: builtins.filterSource - (path: type: type != "directory" || baseNameOf path != "build") - dir; + filterMesonBuild = builtins.filterSource + (path: type: type != "directory" || baseNameOf path != "build"); in -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "nix-eval-jobs"; version = "2.16.0"; src = if srcDir == null then filterMesonBuild ./. else srcDir; - buildInputs = [ + buildInputs = with pkgs; [ nlohmann_json nix boost ]; - nativeBuildInputs = [ + nativeBuildInputs = with pkgs; [ + bear meson pkg-config ninja # nlohmann_json can be only discovered via cmake files cmake - ]; + ] ++ (lib.optional stdenv.cc.isClang [ pkgs.bear pkgs.clang-tools ]); meta = { description = "Hydra's builtin hydra-eval-jobs as a standalone"; diff --git a/flake.nix b/flake.nix index 24efad7..097cffb 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,7 @@ in { packages.nix-eval-jobs = pkgs.callPackage ./default.nix drvArgs; + packages.clangStdenv-nix-eval-jobs = pkgs.callPackage ./default.nix (drvArgs // { stdenv = pkgs.clangStdenv; }); checks.treefmt = pkgs.stdenv.mkDerivation { name = "treefmt-check";