gitice/flake.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

83 lines
2.5 KiB
Nix
Raw Normal View History

2023-02-16 19:38:24 +05:30
{
description = "gitice";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2023-02-16 19:38:24 +05:30
inputs.systems.url = "github:msfjarvis/flake-systems";
inputs.advisory-db.url = "github:rustsec/advisory-db";
inputs.advisory-db.flake = false;
2023-02-16 19:38:24 +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
inputs.fenix.url = "github:nix-community/fenix";
inputs.fenix.inputs.nixpkgs.follows = "nixpkgs";
2023-02-16 19:38:24 +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,
advisory-db,
2023-02-16 19:38:24 +05:30
crane,
fenix,
2023-02-16 19:38:24 +05:30
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {inherit system;};
2023-06-16 01:55:13 +05:30
rustNightly = (import fenix {inherit pkgs;}).fromToolchainFile {
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;
src = craneLib.cleanCargoSource ./.;
2023-05-11 13:31:40 +05:30
nativeBuildInputs = [];
buildInputs = [];
cargoArtifacts = craneLib.buildDepsOnly {
2023-02-16 19:38:24 +05:30
inherit src buildInputs nativeBuildInputs;
};
commonArgs = {
inherit src cargoArtifacts buildInputs nativeBuildInputs;
2023-02-16 19:38:24 +05:30
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
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 =
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];
CARGO_REGISTRIES_CRATES_IO_PROTOCOL = "sparse";
2023-02-16 19:38:24 +05:30
};
});
}