mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-27 02:52:02 +03:00
29 lines
578 B
Nix
29 lines
578 B
Nix
|
{ cargo-deny
|
||
|
, mkCargoDerivation
|
||
|
}:
|
||
|
|
||
|
{ cargoDenyExtraArgs ? ""
|
||
|
, cargoDenyChecks ? "bans licenses sources"
|
||
|
, cargoExtraArgs ? ""
|
||
|
, src
|
||
|
, ...
|
||
|
}@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 ];
|
||
|
})
|