nixpkgs/pkgs/tools/package-management/nixpkgs-review/default.nix

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

71 lines
1.8 KiB
Nix
Raw Normal View History

{ lib
2018-03-27 23:15:38 +00:00
, python3
, fetchFromGitHub
2022-06-07 22:45:01 +00:00
, installShellFiles
2022-06-07 22:45:01 +00:00
, bubblewrap
, nix-output-monitor
2022-06-07 22:45:01 +00:00
, cacert
2018-06-28 21:07:56 +00:00
, git
2022-06-07 22:45:01 +00:00
, nix
, withAutocomplete ? true
2022-06-07 22:45:01 +00:00
, withSandboxSupport ? false
, withNom ? false
2018-03-27 23:15:38 +00:00
}:
python3.pkgs.buildPythonApplication rec {
pname = "nixpkgs-review";
2024-03-25 20:02:02 +00:00
version = "2.10.4";
format = "pyproject";
2018-03-27 23:15:38 +00:00
src = fetchFromGitHub {
owner = "Mic92";
repo = "nixpkgs-review";
2018-03-27 23:15:38 +00:00
rev = version;
2024-03-25 20:02:02 +00:00
hash = "sha256-+4T6Mm4YfH0wWlkNYS03H9Z9oNlYQnVUncvWGA0CKIQ=";
2018-03-27 23:15:38 +00:00
};
nativeBuildInputs = [
installShellFiles
python3.pkgs.setuptools
] ++ lib.optionals withAutocomplete [
python3.pkgs.argcomplete
];
propagatedBuildInputs = [ python3.pkgs.argcomplete ];
2022-06-07 22:45:01 +00:00
makeWrapperArgs =
let
binPath = [ nix git ]
++ lib.optional withSandboxSupport bubblewrap
++ lib.optional withNom nix-output-monitor;
2022-06-07 22:45:01 +00:00
in
[
"--prefix PATH : ${lib.makeBinPath binPath}"
"--set-default NIX_SSL_CERT_FILE ${cacert}/etc/ssl/certs/ca-bundle.crt"
2022-06-07 22:45:01 +00:00
# we don't have any runtime deps but nix-review shells might inject unwanted dependencies
"--unset PYTHONPATH"
];
2018-03-27 23:15:38 +00:00
doCheck = false;
postInstall = lib.optionalString withAutocomplete ''
for cmd in nix-review nixpkgs-review; do
installShellCompletion --cmd $cmd \
2024-03-25 20:02:02 +00:00
--bash <(register-python-argcomplete $cmd) \
--fish <(register-python-argcomplete $cmd -s fish) \
--zsh <(register-python-argcomplete $cmd -s zsh)
done
'';
meta = with lib; {
changelog = "https://github.com/Mic92/nixpkgs-review/releases/tag/${version}";
2018-03-27 23:15:38 +00:00
description = "Review pull-requests on https://github.com/NixOS/nixpkgs";
homepage = "https://github.com/Mic92/nixpkgs-review";
2018-03-27 23:15:38 +00:00
license = licenses.mit;
mainProgram = "nixpkgs-review";
2023-07-23 17:30:22 +00:00
maintainers = with maintainers; [ figsoda mic92 ];
2018-03-27 23:15:38 +00:00
};
}