diff options
author | Michele Guerini Rocco <rnhmjoj@users.noreply.github.com> | 2024-04-12 10:51:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 10:51:57 +0200 |
commit | 044191fb36084f433ac128b925e1253244adac6b (patch) | |
tree | 0c41d58909bffa8aaed8a028ca00e869caedbcad | |
parent | 02cf2a4358dbc84777e3955f3df68a5e908d644b (diff) | |
parent | d00e7644c3e45c04b9e5261a56e783b4c5b2af03 (diff) |
Merge pull request #303512 from bluskript/work/blusk/add-nix-inspect
nix-inspect: init at 0.1.0
-rw-r--r-- | pkgs/by-name/ni/nix-inspect/package.nix | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/by-name/ni/nix-inspect/package.nix b/pkgs/by-name/ni/nix-inspect/package.nix new file mode 100644 index 0000000000000..8d7d39a40b6a8 --- /dev/null +++ b/pkgs/by-name/ni/nix-inspect/package.nix @@ -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"; + }; + } |