2023-11-23 16:34:12 +03:00
|
|
|
{ inputs, ... }: {
|
|
|
|
perSystem = { self', inputs', pkgs, system, ... }:
|
|
|
|
let
|
|
|
|
craneLib = inputs.crane.lib.${system};
|
|
|
|
src = craneLib.cleanCargoSource (craneLib.path ./.);
|
|
|
|
|
|
|
|
commonArgs = {
|
|
|
|
inherit src;
|
|
|
|
strictDeps = true;
|
|
|
|
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
pesto = craneLib.buildPackage commonArgs;
|
|
|
|
checks = {
|
|
|
|
inherit pesto;
|
2023-11-25 19:30:43 +03:00
|
|
|
pesto-clippy = craneLib.cargoClippy (commonArgs // {
|
2023-11-23 16:34:12 +03:00
|
|
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
|
|
|
});
|
2023-11-25 19:30:43 +03:00
|
|
|
pesto-fmt = craneLib.cargoFmt { inherit src; };
|
2023-11-23 16:34:12 +03:00
|
|
|
pesto-nextest = craneLib.cargoNextest (commonArgs // {
|
|
|
|
partitions = 1;
|
|
|
|
partitionType = "count";
|
|
|
|
});
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
packages = { inherit pesto; };
|
|
|
|
inherit checks;
|
|
|
|
devShells.pesto = craneLib.devShell {
|
|
|
|
# Inherit inputs from checks.
|
|
|
|
inherit checks;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|