crane/lib/cargoDeny.nix

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

28 lines
572 B
Nix
Raw Normal View History

{ cargo-deny
, mkCargoDerivation
}:
{ cargoDenyExtraArgs ? ""
, cargoDenyChecks ? "bans licenses sources"
, cargoExtraArgs ? ""
, ...
}@origArgs:
let
args = builtins.removeAttrs origArgs [
"cargoDenyExtraArgs"
"cargoExtraArgs"
];
in
mkCargoDerivation (args // {
buildPhaseCargoCommand = ''
cargo --offline ${cargoExtraArgs} \
deny ${cargoDenyExtraArgs} check ${cargoDenyChecks}
'';
cargoArtifacts = null;
doInstallCargoArtifacts = false;
pnameSuffix = "-deny";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-deny ];
})