use nix-unit from nixpkgs

This commit is contained in:
Jörg Thalheim 2023-12-15 12:15:22 +01:00
parent ad5559974c
commit 0bdf55b09f
4 changed files with 3 additions and 55 deletions

View File

@ -1,5 +1,5 @@
{
perSystem = { pkgs, self', ... }: {
perSystem = { pkgs, ... }: {
checks = {
# check if the `clan config` example jsonschema and data is valid
@ -19,7 +19,7 @@
# check if the `clan config` nix jsonschema converter unit tests succeed
lib-jsonschema-nix-unit-tests = pkgs.runCommand "lib-jsonschema-nix-unit-tests" { } ''
export NIX_PATH=nixpkgs=${pkgs.path}
${self'.packages.nix-unit}/bin/nix-unit \
${pkgs.nix-unit}/bin/nix-unit \
${./.}/test.nix \
--eval-store $(realpath .)
touch $out

View File

@ -30,8 +30,7 @@
in
{
devShells.clan-cli = pkgs.callPackage ./shell.nix {
inherit (self'.packages) clan-cli nix-unit;
# inherit (inputs) democlan;
inherit (self'.packages) clan-cli;
};
packages = {
clan-cli = pkgs.python3.pkgs.callPackage ./default.nix {

View File

@ -13,7 +13,6 @@
inherit (config.packages) tea-create-pr;
};
pending-reviews = pkgs.callPackage ./pending-reviews { };
nix-unit = pkgs.callPackage ./nix-unit { };
meshname = pkgs.callPackage ./meshname { };
} // lib.optionalAttrs pkgs.stdenv.isLinux {
aemu = pkgs.callPackage ./aemu { };

View File

@ -1,50 +0,0 @@
{ stdenv
, lib
, nixVersions
, fetchFromGitHub
, nlohmann_json
, boost
, meson
, pkg-config
, ninja
, cmake
, clang-tools
, difftastic
, makeWrapper
}:
stdenv.mkDerivation {
pname = "nix-unit";
version = "0.1";
src = fetchFromGitHub {
owner = "adisbladis";
repo = "nix-unit";
rev = "7e2ee1c70f930b9b65b9fc33c3f3eca0dfae00d1";
sha256 = "sha256-UaUkh+/lxzNCRH64YB6SbyRIvvDhgY98izX9CvWgJA4=";
};
buildInputs = [
nlohmann_json
nixVersions.nix_2_18
boost
];
nativeBuildInputs = [
meson
pkg-config
ninja
# nlohmann_json can be only discovered via cmake files
cmake
makeWrapper
] ++ (lib.optional stdenv.cc.isClang [ clang-tools ]);
postInstall = ''
wrapProgram "$out/bin/nix-unit" --prefix PATH : ${difftastic}/bin
'';
meta = {
description = "Nix unit test runner";
homepage = "https://github.com/adisbladis/nix-unit";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ adisbladis ];
platforms = lib.platforms.unix;
};
}