Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target/
**/*.rs.bk
Cargo.lock
tags
.pre-commit-config.yaml
73 changes: 17 additions & 56 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 12 additions & 41 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{
description = "Description for the project";
description = "Tonic - A native gRPC client & server implementation with async/await support.";

inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};

git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
inputs.nixpkgs.follows = "nixpkgs";
};
};

Expand All @@ -36,15 +29,8 @@
system,
...
}:
let
rustToolchain = pkgs.fenix.stable;
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ inputs.fenix.overlays.default ];
config = { };
};
_module.args.pkgs = import inputs.nixpkgs { inherit system; };

formatter = config.treefmt.build.wrapper;
checks.formatting = config.treefmt.build.check self;
Expand All @@ -54,27 +40,14 @@
settings.hooks = {
actionlint.enable = true;
shellcheck.enable = true;
clippy = {
enable = true;
packageOverrides = {
cargo = rustToolchain.cargo;
clippy = rustToolchain.clippy;
};
};
clippy.enable = true;
cargo-check = {
enable = true;
package = rustToolchain.cargo;
entry = "${rustToolchain.cargo}/bin/cargo check --workspace --all-features";
entry = "${pkgs.lib.getExe pkgs.cargo} check --workspace --all-features";
files = "\\.rs$";
pass_filenames = false;
};
rustfmt = {
enable = true;
packageOverrides = {
rustfmt = rustToolchain.rustfmt;
cargo = rustToolchain.cargo;
};
};
rustfmt.enable = true;
};
};

Expand All @@ -83,15 +56,13 @@
cargo-nextest
pre-commit
cmake
protobuf

(rustToolchain.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
])
cargo
clippy
rustc
rustfmt
rust-analyzer
];

hardeningDisable = [ "fortify" ];
Expand Down
Loading