Merge pull request #303512 from bluskript/work/blusk/add-nix-inspect

nix-inspect: init at 0.1.0
This commit is contained in:
Michele Guerini Rocco 2024-04-12 10:51:57 +02:00 committed by GitHub
commit 044191fb36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,60 @@
{
lib,
rustPlatform,
fetchFromGitHub,
boost,
nlohmann_json,
nixVersions,
pkg-config,
meson,
ninja,
stdenv,
}: let
src = fetchFromGitHub {
owner = "bluskript";
repo = "nix-inspect";
rev = "3d0fea2bb246130825548fce331093ee9cc9c20b";
hash = "sha256-JichXRSfTLfy+7fhbTvA89rQLkqsY2eHgEAeAHWbA9s=";
};
workerPackage = stdenv.mkDerivation {
inherit src;
pname = "nix-inspect-worker";
version = "0.1.0";
sourceRoot = "source/worker";
nativeBuildInputs = [meson ninja pkg-config];
buildInputs = [
boost
nlohmann_json
nixVersions.nix_2_19.dev
];
mesonBuildType = "release";
};
in
rustPlatform.buildRustPackage {
inherit src;
pname = "nix-inspect";
version = "0.1.0";
cargoHash = "sha256-FdpHdw7bg/nEG4GjYhrdIDB4MJ4n5LoWnW4mTG2Lh5I=";
buildInputs = [workerPackage];
postPatch = ''
substituteInPlace src/workers.rs \
--replace-fail 'env!("WORKER_BINARY_PATH")' '"${workerPackage}/bin/nix-inspect"'
'';
meta = with lib; {
description = "A Rust package for inspecting Nix expressions";
homepage = "https://github.com/bluskript/nix-inspect";
license = licenses.mit;
maintainers = with maintainers; [blusk];
platforms = platforms.unix;
mainProgram = "nix-inspect";
};
}