mirror of
https://github.com/msfjarvis/gitice
synced 2025-08-14 19:47:01 +05:30
refactor(flakes): use filtered source and extract args
This commit is contained in:
parent
c382b1d84c
commit
6c02e4edfd
1 changed files with 15 additions and 13 deletions
24
flake.nix
24
flake.nix
|
@ -53,7 +53,7 @@
|
|||
rustStable =
|
||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||
src = ./.;
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
perl
|
||||
pkg-config
|
||||
|
@ -63,24 +63,26 @@
|
|||
[pkgs.openssl]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin
|
||||
[pkgs.darwin.apple_sdk.frameworks.Security];
|
||||
cargoArtifacts = craneLib.buildDepsOnly {inherit src buildInputs nativeBuildInputs;};
|
||||
|
||||
gitice = craneLib.buildPackage {
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
inherit src buildInputs nativeBuildInputs;
|
||||
doCheck = false;
|
||||
};
|
||||
gitice-clippy = craneLib.cargoClippy {
|
||||
inherit cargoArtifacts src buildInputs nativeBuildInputs;
|
||||
|
||||
commonArgs = {
|
||||
inherit src cargoArtifacts buildInputs nativeBuildInputs;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
};
|
||||
gitice-fmt = craneLib.cargoFmt {inherit src;};
|
||||
|
||||
gitice = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
||||
gitice-clippy = craneLib.cargoClippy (commonArgs // {});
|
||||
gitice-fmt = craneLib.cargoFmt (commonArgs // {});
|
||||
gitice-audit =
|
||||
craneLib.cargoAudit {inherit src advisory-db;};
|
||||
gitice-nextest = craneLib.cargoNextest {
|
||||
inherit cargoArtifacts src buildInputs nativeBuildInputs;
|
||||
craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
||||
gitice-nextest = craneLib.cargoNextest (commonArgs
|
||||
// {
|
||||
partitions = 1;
|
||||
partitionType = "count";
|
||||
};
|
||||
});
|
||||
in {
|
||||
checks = {
|
||||
inherit gitice gitice-audit gitice-clippy gitice-fmt gitice-nextest;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue