adnix-rs/flake.nix

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

105 lines
2.7 KiB
Nix
Raw Normal View History

2022-12-16 12:04:17 +05:30
{
description = "adnix";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
2022-12-16 12:04:17 +05:30
inputs.systems.url = "github:msfjarvis/flake-systems";
inputs.advisory-db.url = "github:rustsec/advisory-db";
inputs.advisory-db.flake = false;
2022-12-16 12:04:17 +05:30
inputs.crane.url = "github:ipetkov/crane";
inputs.crane.inputs.nixpkgs.follows = "nixpkgs";
2022-12-18 05:10:34 +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";
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;
2022-12-16 12:04:17 +05:30
outputs = {
self,
nixpkgs,
advisory-db,
2022-12-16 12:04:17 +05:30
crane,
devshell,
fenix,
2022-12-16 12:04:17 +05:30
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
rustStable = (import fenix {inherit pkgs;}).fromToolchainFile {
file = ./rust-toolchain.toml;
2024-04-10 22:04:15 +05:30
sha256 = "sha256-7QfkHty6hSrgNM0fspycYkRcB82eEqYa4CoAJ9qA3tU=";
2022-12-16 12:04:17 +05:30
};
craneLib = (crane.mkLib pkgs).overrideToolchain rustStable;
2023-03-10 12:25:26 +05:30
commonArgs = {
src = craneLib.cleanCargoSource ./.;
buildInputs = [];
nativeBuildInputs = [];
2022-12-16 12:04:17 +05:30
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
};
2023-03-10 12:25:26 +05:30
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {doCheck = false;});
adnix = craneLib.buildPackage (commonArgs
// {
doCheck = false;
});
adnix-clippy = craneLib.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
});
adnix-fmt = craneLib.cargoFmt (commonArgs // {});
adnix-audit = craneLib.cargoAudit (commonArgs // {inherit advisory-db;});
adnix-nextest = craneLib.cargoNextest (commonArgs
// {
inherit cargoArtifacts;
src = ./.;
partitions = 1;
partitionType = "count";
});
2022-12-16 12:04:17 +05:30
in {
checks = {
inherit adnix adnix-audit adnix-clippy adnix-fmt adnix-nextest;
2022-12-16 12:04:17 +05:30
};
packages.default = adnix;
apps.default = flake-utils.lib.mkApp {drv = adnix;};
devShells.default = pkgs.devshell.mkShell {
bash = {interactive = "";};
2022-12-16 12:04:17 +05:30
env = [
{
name = "DEVSHELL_NO_MOTD";
value = 1;
}
];
packages = with pkgs; [
2023-11-03 01:45:59 +05:30
cargo-dist
2022-12-16 12:04:17 +05:30
cargo-nextest
cargo-release
oranda
2023-12-29 11:26:25 +05:30
rustStable
stdenv.cc
2022-12-16 12:04:17 +05:30
];
};
});
}