mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 20:34:06 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
90 lines
2.0 KiB
Nix
90 lines
2.0 KiB
Nix
{
|
|
lib,
|
|
python3Packages,
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
bubblewrap,
|
|
nix-output-monitor,
|
|
cacert,
|
|
git,
|
|
nix,
|
|
versionCheckHook,
|
|
|
|
withAutocomplete ? true,
|
|
withSandboxSupport ? false,
|
|
withNom ? false,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "nixpkgs-review";
|
|
version = "2.12.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Mic92";
|
|
repo = "nixpkgs-review";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-yNdBqL3tceuoUHx8/j2y5ZTq1zeVDAm37RZtlCbC6rg=";
|
|
};
|
|
|
|
build-system = [
|
|
python3Packages.setuptools
|
|
];
|
|
|
|
dependencies = lib.optionals withAutocomplete [
|
|
python3Packages.argcomplete
|
|
];
|
|
|
|
nativeBuildInputs =
|
|
[
|
|
installShellFiles
|
|
]
|
|
++ lib.optionals withAutocomplete [
|
|
python3Packages.argcomplete
|
|
];
|
|
|
|
makeWrapperArgs =
|
|
let
|
|
binPath =
|
|
[
|
|
nix
|
|
git
|
|
]
|
|
++ lib.optional withSandboxSupport bubblewrap
|
|
++ lib.optional withNom nix-output-monitor;
|
|
in
|
|
[
|
|
"--prefix PATH : ${lib.makeBinPath binPath}"
|
|
"--set-default NIX_SSL_CERT_FILE ${cacert}/etc/ssl/certs/ca-bundle.crt"
|
|
# we don't have any runtime deps but nixpkgs-review shells might inject unwanted dependencies
|
|
"--unset PYTHONPATH"
|
|
];
|
|
|
|
postInstall = lib.optionalString withAutocomplete ''
|
|
for cmd in nix-review nixpkgs-review; do
|
|
installShellCompletion --cmd $cmd \
|
|
--bash <(register-python-argcomplete $cmd) \
|
|
--fish <(register-python-argcomplete $cmd -s fish) \
|
|
--zsh <(register-python-argcomplete $cmd -s zsh)
|
|
done
|
|
'';
|
|
|
|
nativeCheckInputs = [
|
|
versionCheckHook
|
|
];
|
|
versionCheckProgramArg = [ "--version" ];
|
|
|
|
meta = {
|
|
changelog = "https://github.com/Mic92/nixpkgs-review/releases/tag/${version}";
|
|
description = "Review pull-requests on https://github.com/NixOS/nixpkgs";
|
|
homepage = "https://github.com/Mic92/nixpkgs-review";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "nixpkgs-review";
|
|
maintainers = with lib.maintainers; [
|
|
figsoda
|
|
mic92
|
|
];
|
|
};
|
|
}
|