gitice/flake.nix

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

100 lines
2.7 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.nixpkgs.follows = "nixpkgs";
2023-02-16 19:38:24 +05:30
inputs.devshell.url = "github:numtide/devshell";
inputs.devshell.inputs.nixpkgs.follows = "nixpkgs";
2024-01-31 11:26:49 +05:30
inputs.devshell.inputs.flake-utils.follows = "flake-utils";
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 = {
nixpkgs,
advisory-db,
2023-02-16 19:38:24 +05:30
crane,
devshell,
fenix,
2023-02-16 19:38:24 +05:30
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
2023-06-16 01:55:13 +05:30
rustNightly = (import fenix {inherit pkgs;}).fromToolchainFile {
file = ./rust-toolchain.toml;
2024-03-14 17:53:22 +05:30
sha256 = "sha256-Je+rS6Tgc04HqvDj2XvjOpbyIAcEee0JqqrG7+cUydI=";
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 = {
2024-03-14 18:15:30 +05:30
inherit gitice gitice-audit gitice-clippy gitice-fmt gitice-nextest;
2023-02-16 19:38:24 +05:30
};
packages.default = gitice;
apps.default = flake-utils.lib.mkApp {drv = gitice;};
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
env = [
{
name = "DEVSHELL_NO_MOTD";
value = 1;
}
];
packages = with pkgs; [
2023-11-03 02:08:46 +05:30
cargo-dist
cargo-nextest
cargo-release
2023-10-24 17:30:59 +05:30
git-cliff
rustNightly
2023-12-29 11:28:19 +05:30
stdenv.cc
];
2023-02-16 19:38:24 +05:30
};
});
}