2023-02-16 19:38:24 +05:30
|
|
|
{
|
|
|
|
description = "gitice";
|
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2023-02-16 19:38:24 +05:30
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.systems.url = "github:msfjarvis/flake-systems";
|
2023-05-15 11:41:25 +05:30
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.advisory-db.url = "github:rustsec/advisory-db";
|
|
|
|
inputs.advisory-db.flake = false;
|
2023-02-16 19:38:24 +05:30
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.crane.url = "github:ipetkov/crane";
|
|
|
|
inputs.crane.inputs.flake-compat.follows = "flake-compat";
|
|
|
|
inputs.crane.inputs.flake-utils.follows = "flake-utils";
|
|
|
|
inputs.crane.inputs.nixpkgs.follows = "nixpkgs";
|
2023-02-16 19:38:24 +05:30
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.fenix.url = "github:nix-community/fenix";
|
|
|
|
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
|
2023-02-16 19:38:24 +05:30
|
|
|
|
2023-06-26 00:43:35 +05:30
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
inputs.flake-utils.inputs.systems.follows = "systems";
|
|
|
|
|
|
|
|
inputs.flake-compat.url = "github:nix-community/flake-compat";
|
|
|
|
inputs.flake-compat.flake = false;
|
2023-02-16 19:38:24 +05:30
|
|
|
|
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2023-06-26 00:43:35 +05:30
|
|
|
advisory-db,
|
2023-02-16 19:38:24 +05:30
|
|
|
crane,
|
2023-06-26 00:43:35 +05:30
|
|
|
fenix,
|
2023-02-16 19:38:24 +05:30
|
|
|
flake-utils,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
flake-utils.lib.eachDefaultSystem (system: let
|
2023-05-15 11:41:25 +05:30
|
|
|
pkgs = import nixpkgs {inherit system;};
|
|
|
|
|
2023-06-16 01:55:13 +05:30
|
|
|
rustNightly = (import fenix {inherit pkgs;}).fromToolchainFile {
|
2023-05-15 11:41:25 +05:30
|
|
|
file = ./rust-toolchain.toml;
|
2023-06-16 01:48:15 +05:30
|
|
|
sha256 = "sha256-0t+XYT0Om/dDfjsFljZLULbQNJ4hMysyvUnHEoAryAk=";
|
2023-02-16 19:38:24 +05:30
|
|
|
};
|
|
|
|
|
2023-06-16 01:55:13 +05:30
|
|
|
craneLib = (crane.mkLib pkgs).overrideToolchain rustNightly;
|
2023-05-11 13:22:24 +05:30
|
|
|
src = craneLib.cleanCargoSource ./.;
|
2023-05-11 13:31:40 +05:30
|
|
|
nativeBuildInputs = [];
|
|
|
|
buildInputs = [];
|
2023-05-11 13:22:24 +05:30
|
|
|
cargoArtifacts = craneLib.buildDepsOnly {
|
2023-02-16 19:38:24 +05:30
|
|
|
inherit src buildInputs nativeBuildInputs;
|
|
|
|
};
|
2023-05-11 13:22:24 +05:30
|
|
|
|
|
|
|
commonArgs = {
|
|
|
|
inherit src cargoArtifacts buildInputs nativeBuildInputs;
|
2023-02-16 19:38:24 +05:30
|
|
|
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
|
|
|
|
};
|
2023-05-11 13:22:24 +05:30
|
|
|
|
|
|
|
gitice = craneLib.buildPackage (commonArgs // {doCheck = false;});
|
|
|
|
gitice-clippy = craneLib.cargoClippy (commonArgs // {});
|
|
|
|
gitice-fmt = craneLib.cargoFmt (commonArgs // {});
|
2023-02-16 19:38:24 +05:30
|
|
|
gitice-audit =
|
2023-05-11 13:22:24 +05:30
|
|
|
craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
|
|
|
|
gitice-nextest = craneLib.cargoNextest (commonArgs
|
|
|
|
// {
|
|
|
|
partitions = 1;
|
|
|
|
partitionType = "count";
|
|
|
|
});
|
2023-02-16 19:38:24 +05:30
|
|
|
in {
|
|
|
|
checks = {
|
|
|
|
inherit gitice gitice-audit gitice-clippy gitice-fmt gitice-nextest;
|
|
|
|
};
|
|
|
|
|
|
|
|
packages.default = gitice;
|
|
|
|
|
|
|
|
apps.default = flake-utils.lib.mkApp {drv = gitice;};
|
|
|
|
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
inputsFrom = builtins.attrValues self.checks;
|
|
|
|
|
2023-06-16 01:55:13 +05:30
|
|
|
nativeBuildInputs = with pkgs; [cargo-dist cargo-nextest cargo-release rustNightly];
|
2023-05-10 13:57:11 +05:30
|
|
|
|
|
|
|
CARGO_REGISTRIES_CRATES_IO_PROTOCOL = "sparse";
|
2023-02-16 19:38:24 +05:30
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|