mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00

We have added nixpkgs-vet as a regular package to nixpkgs a while ago, so we can now use it from pinned nixpkgs. This avoids pulling a platform-specific binary version from upstream. This change also allows to run the tool easily locally, the same way as other tools: nix-build ci -A nixpkgs-vet This will do a full check of the repo with the exception of nixpkgs-vet's "ratchet" checks: Those depend on having two branches to compare, but the default is to only look at the head branch. Those ratchet checks will still be run in CI, though.
31 lines
417 B
Nix
31 lines
417 B
Nix
{
|
|
lib,
|
|
nix,
|
|
nixpkgs-vet,
|
|
runCommand,
|
|
}:
|
|
{
|
|
base ? ../.,
|
|
head ? ../.,
|
|
}:
|
|
let
|
|
filtered =
|
|
with lib.fileset;
|
|
path:
|
|
toSource {
|
|
fileset = (gitTracked path);
|
|
root = path;
|
|
};
|
|
in
|
|
runCommand "nixpkgs-vet"
|
|
{
|
|
nativeBuildInputs = [
|
|
nixpkgs-vet
|
|
];
|
|
env.NIXPKGS_VET_NIX_PACKAGE = nix;
|
|
}
|
|
''
|
|
nixpkgs-vet --base ${filtered base} ${filtered head}
|
|
|
|
touch $out
|
|
''
|