noogle/pesto/flake-module.nix

34 lines
947 B
Nix
Raw Normal View History

{ 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 // {
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
2023-11-25 19:30:43 +03:00
pesto-fmt = craneLib.cargoFmt { inherit src; };
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;
};
};
}