nixpkgs/ci/nixpkgs-vet.nix
Wolfgang Walther 942c377476
workflows/nixpkgs-vet: use nixpkgs-vet from pinned nixpkgs
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.
2025-05-25 15:01:42 +02:00

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
''