feat: Rust templates
This commit is contained in:
parent
50a0f0abc2
commit
e5faf58ba8
33 changed files with 630 additions and 1 deletions
52
rust/cargo-stable/crane/flake.nix
Normal file
52
rust/cargo-stable/crane/flake.nix
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
systems.url = "github:nix-systems/default";
|
||||
|
||||
crane.url = "github:ipetkov/crane";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, systems, crane, ... }:
|
||||
let eachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||
in {
|
||||
packages = eachSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
hello = pkgs.callPackage ./package.nix {
|
||||
craneLib = crane.mkLib pkgs;
|
||||
};
|
||||
default = self.packages.${system}.hello;
|
||||
});
|
||||
|
||||
devShells = eachSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
default = import ./shell.nix { inherit pkgs crane; };
|
||||
});
|
||||
|
||||
checks = eachSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
craneLib = crane.mkLib pkgs;
|
||||
crate = self.packages.${system}.default;
|
||||
in {
|
||||
inherit crate;
|
||||
|
||||
clippy = craneLib.cargoClippy (
|
||||
crate.commonArgs
|
||||
// {
|
||||
inherit (crate) cargoArtifacts;
|
||||
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
||||
}
|
||||
);
|
||||
|
||||
doc = craneLib.cargoDoc (
|
||||
crate.commonArgs
|
||||
// {
|
||||
inherit (crate) cargoArtifacts;
|
||||
env.RUSTDOCFLAGS = "--deny warnings";
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue