mirror of
https://github.com/msfjarvis/clipboard-substitutor
synced 2025-08-15 05:27:01 +05:30
feat(nix): refactor out common args
This commit is contained in:
parent
68a2832f2a
commit
03be69dec8
1 changed files with 23 additions and 21 deletions
32
flake.nix
32
flake.nix
|
@ -53,29 +53,31 @@
|
||||||
rustStable =
|
rustStable =
|
||||||
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
|
||||||
src = ./.;
|
commonArgs = {
|
||||||
|
src = craneLib.cleanCargoSource ./.;
|
||||||
buildInputs = with pkgs;
|
buildInputs = with pkgs;
|
||||||
[xorg.libxcb python39]
|
[xorg.libxcb python39]
|
||||||
++ pkgs.lib.optionals stdenv.isDarwin
|
++ pkgs.lib.optionals stdenv.isDarwin
|
||||||
[pkgs.darwin.apple_sdk.frameworks.AppKit];
|
[pkgs.darwin.apple_sdk.frameworks.AppKit];
|
||||||
cargoArtifacts = craneLib.buildDepsOnly {inherit src buildInputs;};
|
nativeBuildInputs = [];
|
||||||
|
|
||||||
clipboard-substitutor = craneLib.buildPackage {
|
|
||||||
inherit src buildInputs;
|
|
||||||
doCheck = false;
|
|
||||||
};
|
|
||||||
clipboard-substitutor-clippy = craneLib.cargoClippy {
|
|
||||||
inherit cargoArtifacts src buildInputs;
|
|
||||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||||
};
|
};
|
||||||
clipboard-substitutor-fmt = craneLib.cargoFmt {inherit src;};
|
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
|
||||||
clipboard-substitutor-audit =
|
|
||||||
craneLib.cargoAudit {inherit src advisory-db;};
|
clipboard-substitutor = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
||||||
clipboard-substitutor-nextest = craneLib.cargoNextest {
|
clipboard-substitutor-clippy = craneLib.cargoClippy (commonArgs
|
||||||
inherit cargoArtifacts src buildInputs;
|
// {
|
||||||
|
inherit cargoArtifacts;
|
||||||
|
});
|
||||||
|
clipboard-substitutor-fmt = craneLib.cargoFmt (commonArgs // {});
|
||||||
|
clipboard-substitutor-audit = craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
||||||
|
clipboard-substitutor-nextest = craneLib.cargoNextest (commonArgs
|
||||||
|
// {
|
||||||
|
inherit cargoArtifacts;
|
||||||
|
src = ./.;
|
||||||
partitions = 1;
|
partitions = 1;
|
||||||
partitionType = "count";
|
partitionType = "count";
|
||||||
};
|
});
|
||||||
in {
|
in {
|
||||||
checks = {
|
checks = {
|
||||||
# TODO: migrate to cargo-audit
|
# TODO: migrate to cargo-audit
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue