Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

88 lines
2.7 KiB
Nix
Raw Permalink Normal View History

{
lib,
2025-07-03 16:51:39 +09:00
stdenv,
rustPlatform,
fetchFromGitHub,
2024-07-24 14:19:21 -04:00
boost,
cmake,
vectorscan,
2024-07-24 14:19:21 -04:00
openssl,
pkg-config,
2025-07-03 16:51:39 +09:00
installShellFiles,
2025-07-03 16:48:26 +09:00
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
pname = "noseyparker";
2025-05-09 01:52:40 +00:00
version = "0.24.0";
src = fetchFromGitHub {
owner = "praetorian-inc";
repo = "noseyparker";
rev = "v${version}";
2025-05-09 01:52:40 +00:00
hash = "sha256-6GxkIxLEgbIgg4nSHvmRedm8PAPBwVxLQUnQzh3NonA=";
};
2025-05-09 01:52:40 +00:00
cargoHash = "sha256-hVBHIm/12WU6g45QMxxuGk41B0kwThk7A84fOxArvno=";
2024-07-24 14:19:21 -04:00
checkFlags = [
# These tests expect access to network to clone and use GitHub API
"--skip=github::github_repos_list_multiple_user_dedupe_jsonl_format"
"--skip=github::github_repos_list_org_badtoken"
"--skip=github::github_repos_list_user_badtoken"
"--skip=github::github_repos_list_user_human_format"
"--skip=github::github_repos_list_user_json_format"
"--skip=github::github_repos_list_user_jsonl_format"
2024-10-12 12:01:37 +02:00
"--skip=github::github_repos_list_user_repo_filter"
2024-07-24 14:19:21 -04:00
"--skip=scan::appmaker::scan_workflow_from_git_url"
2025-07-03 19:48:19 +09:00
# This caused a flaky result. See https://github.com/NixOS/nixpkgs/pull/422012#issuecomment-3031728181
"--skip=scan::git_url::git_binary_missing"
# Also skips all tests which depend on external git command to prevent unstable tests similar to git_binary_missing
# See https://github.com/NixOS/nixpkgs/pull/422012#discussion_r2182551619
"--skip=scan::git_url::https_nonexistent"
"--skip=scan::basic::scan_git_emptyrepo"
2024-07-24 14:19:21 -04:00
];
nativeBuildInputs = [
cmake
pkg-config
2025-07-03 16:51:39 +09:00
installShellFiles
];
buildInputs = [
2024-07-24 14:19:21 -04:00
boost
vectorscan
2024-07-24 14:19:21 -04:00
openssl
];
OPENSSL_NO_VENDOR = 1;
2025-07-03 16:51:39 +09:00
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
2025-07-03 17:13:13 +09:00
mkdir -p manpages
"$out/bin/noseyparker-cli" generate manpages
installManPage manpages/*
2025-07-03 16:51:39 +09:00
installShellCompletion --cmd noseyparker-cli \
--bash <("$out/bin/noseyparker-cli" generate shell-completions --shell bash) \
--zsh <("$out/bin/noseyparker-cli" generate shell-completions --shell zsh) \
--fish <("$out/bin/noseyparker-cli" generate shell-completions --shell fish)
'';
2025-07-03 16:48:26 +09:00
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/noseyparker-cli";
versionCheckProgramArg = "--version";
2025-06-03 16:15:50 +02:00
meta = {
description = "Find secrets and sensitive information in textual data";
mainProgram = "noseyparker";
homepage = "https://github.com/praetorian-inc/noseyparker";
changelog = "https://github.com/praetorian-inc/noseyparker/blob/v${version}/CHANGELOG.md";
2025-06-03 16:15:50 +02:00
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ _0x4A6F ];
};
}