2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
, installShellFiles
|
2022-06-16 17:23:12 +00:00
|
|
|
, bubblewrap
|
2023-03-24 00:07:29 +00:00
|
|
|
, nix-output-monitor
|
2022-06-16 17:23:12 +00:00
|
|
|
, cacert
|
2020-04-24 23:36:52 +00:00
|
|
|
, git
|
2022-06-16 17:23:12 +00:00
|
|
|
, nix
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
, withAutocomplete ? true
|
2022-06-16 17:23:12 +00:00
|
|
|
, withSandboxSupport ? false
|
2023-03-24 00:07:29 +00:00
|
|
|
, withNom ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "nixpkgs-review";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.10.2";
|
2023-08-10 07:59:29 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Mic92";
|
|
|
|
repo = "nixpkgs-review";
|
|
|
|
rev = version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-x41piT7peYV3sNMVYsqcjCU4u+PayZb05JIWBeWF7jw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
python3.pkgs.setuptools
|
|
|
|
] ++ lib.optionals withAutocomplete [
|
|
|
|
python3.pkgs.argcomplete
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ python3.pkgs.argcomplete ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
makeWrapperArgs =
|
|
|
|
let
|
2023-03-24 00:07:29 +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
|
|
|
|
2021-04-22 02:08:21 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
postInstall = lib.optionalString withAutocomplete ''
|
|
|
|
for cmd in nix-review nixpkgs-review; do
|
|
|
|
installShellCompletion --cmd $cmd \
|
|
|
|
--bash <(register-python-argcomplete $out/bin/$cmd) \
|
|
|
|
--fish <(register-python-argcomplete $out/bin/$cmd -s fish) \
|
|
|
|
--zsh <(register-python-argcomplete $out/bin/$cmd -s zsh)
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
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";
|
|
|
|
license = licenses.mit;
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "nixpkgs-review";
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ figsoda mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|