2024-10-04 16:56:33 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
python3Packages,
|
|
|
|
fetchFromGitHub,
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
installShellFiles,
|
|
|
|
bubblewrap,
|
|
|
|
nix-output-monitor,
|
|
|
|
cacert,
|
|
|
|
git,
|
|
|
|
nix,
|
2024-10-11 05:15:48 +00:00
|
|
|
versionCheckHook,
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
withAutocomplete ? true,
|
|
|
|
withSandboxSupport ? false,
|
|
|
|
withNom ? false,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "nixpkgs-review";
|
2024-10-11 05:15:48 +00:00
|
|
|
version = "2.12.0";
|
2024-10-04 16:56:33 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Mic92";
|
|
|
|
repo = "nixpkgs-review";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-10-11 05:15:48 +00:00
|
|
|
hash = "sha256-yNdBqL3tceuoUHx8/j2y5ZTq1zeVDAm37RZtlCbC6rg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
build-system = [
|
|
|
|
python3Packages.setuptools
|
2023-08-10 07:59:29 +00:00
|
|
|
];
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
dependencies = lib.optionals withAutocomplete [
|
|
|
|
python3Packages.argcomplete
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
[
|
|
|
|
installShellFiles
|
|
|
|
]
|
|
|
|
++ lib.optionals withAutocomplete [
|
|
|
|
python3Packages.argcomplete
|
|
|
|
];
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
makeWrapperArgs =
|
|
|
|
let
|
2024-10-04 16:56:33 +00:00
|
|
|
binPath = [
|
|
|
|
nix
|
|
|
|
git
|
|
|
|
] ++ lib.optional withSandboxSupport bubblewrap ++ lib.optional withNom nix-output-monitor;
|
2022-06-16 17:23:12 +00:00
|
|
|
in
|
|
|
|
[
|
|
|
|
"--prefix PATH : ${lib.makeBinPath binPath}"
|
2023-03-24 00:07:29 +00:00
|
|
|
"--set-default NIX_SSL_CERT_FILE ${cacert}/etc/ssl/certs/ca-bundle.crt"
|
2022-06-16 17:23:12 +00:00
|
|
|
# we don't have any runtime deps but nix-review shells might inject unwanted dependencies
|
|
|
|
"--unset PYTHONPATH"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
postInstall = lib.optionalString withAutocomplete ''
|
|
|
|
for cmd in nix-review nixpkgs-review; do
|
|
|
|
installShellCompletion --cmd $cmd \
|
2024-04-21 15:54:59 +00:00
|
|
|
--bash <(register-python-argcomplete $cmd) \
|
|
|
|
--fish <(register-python-argcomplete $cmd -s fish) \
|
|
|
|
--zsh <(register-python-argcomplete $cmd -s zsh)
|
2023-08-10 07:59:29 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2024-10-11 05:15:48 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
versionCheckHook
|
|
|
|
];
|
|
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
|
|
|
|
meta = {
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/Mic92/nixpkgs-review/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Review pull-requests on https://github.com/NixOS/nixpkgs";
|
|
|
|
homepage = "https://github.com/Mic92/nixpkgs-review";
|
2024-10-11 05:15:48 +00:00
|
|
|
license = lib.licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "nixpkgs-review";
|
2024-10-11 05:15:48 +00:00
|
|
|
maintainers = with lib.maintainers; [
|
2024-10-04 16:56:33 +00:00
|
|
|
figsoda
|
|
|
|
mic92
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|