Make lint run
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
6813a9ed43
commit
4e968aaea0
6 changed files with 66 additions and 7 deletions
57
flake.nix
57
flake.nix
|
|
@ -32,6 +32,9 @@
|
|||
];
|
||||
};
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
toolchain = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)).toolchain.channel;
|
||||
rustTarget = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
|
||||
dylintLib = inputs.dylint.mkLib {
|
||||
|
|
@ -39,7 +42,57 @@
|
|||
inherit (inputs) crane;
|
||||
};
|
||||
|
||||
lints = [ ];
|
||||
craneLib = (inputs.crane.mkLib pkgs).overrideToolchain rustTarget;
|
||||
|
||||
src = craneLib.cleanCargoSource ./.;
|
||||
|
||||
commonLintArgs = {
|
||||
inherit src;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = [ pkgs.openssl ];
|
||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||
|
||||
DOCS_RS = "true";
|
||||
RUSTUP_TOOLCHAIN = toolchain;
|
||||
};
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly commonLintArgs;
|
||||
|
||||
individualLintArgs = commonLintArgs // {
|
||||
inherit cargoArtifacts;
|
||||
inherit (craneLib.crateNameFromCargoToml { inherit src; }) version;
|
||||
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
fileSetForCrate =
|
||||
crate:
|
||||
lib.fileset.toSource {
|
||||
root = ./.;
|
||||
fileset = lib.fileset.unions [
|
||||
./Cargo.lock
|
||||
./Cargo.toml
|
||||
(craneLib.fileset.commonCargoSources ./hakari)
|
||||
(craneLib.fileset.commonCargoSources crate)
|
||||
];
|
||||
};
|
||||
|
||||
dashmap-ref = craneLib.buildPackage (
|
||||
individualLintArgs
|
||||
// {
|
||||
pname = "dashmap-ref";
|
||||
cargoExtraArgs = "-p dashmap-ref";
|
||||
src = fileSetForCrate ./lints/dashmap-ref;
|
||||
}
|
||||
);
|
||||
|
||||
lints = [
|
||||
{
|
||||
inherit toolchain;
|
||||
package = dashmap-ref;
|
||||
}
|
||||
];
|
||||
dylint = dylintLib.mkDylint { inherit lints; };
|
||||
in
|
||||
{
|
||||
|
|
@ -49,6 +102,8 @@
|
|||
dylint
|
||||
|
||||
pkgs.cargo-hakari
|
||||
pkgs.openssl
|
||||
pkgs.pkg-config
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue