From 29d57a13a248f832394564de6d96e2838fe77ea8 Mon Sep 17 00:00:00 2001 From: Vinicius Deolindo Date: Tue, 19 May 2026 00:39:56 -0300 Subject: [PATCH 1/5] gitignore: add `.pre-commit-config.yaml` --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6ae3d3c32..fffb1c850 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target/ **/*.rs.bk Cargo.lock tags +.pre-commit-config.yaml From 997096d06c7323e8308aa447bbefb444ee1fec65 Mon Sep 17 00:00:00 2001 From: Vinicius Deolindo Date: Tue, 19 May 2026 00:35:27 -0300 Subject: [PATCH 2/5] flake: add `protobuf` to the devshell --- flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/flake.nix b/flake.nix index 731eb6835..0274b30f1 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,7 @@ cargo-nextest pre-commit cmake + protobuf (rustToolchain.withComponents [ "cargo" From 43e8389d54efaeeb132bb9cd3a9274cfdd7ebd55 Mon Sep 17 00:00:00 2001 From: Vinicius Deolindo Date: Tue, 19 May 2026 00:37:12 -0300 Subject: [PATCH 3/5] flake: update lockfile --- flake.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 035b4272b..3ff57f183 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1755585599, - "narHash": "sha256-tl/0cnsqB/Yt7DbaGMel2RLa7QG5elA8lkaOXli6VdY=", + "lastModified": 1779099656, + "narHash": "sha256-x+PMKsZHKbgNbWrkyNP58xb4LrQfzzFd0QJVnPc+VnY=", "owner": "nix-community", "repo": "fenix", - "rev": "6ed03ef4c8ec36d193c18e06b9ecddde78fb7e42", + "rev": "f553608656def48a8aa2984b85f27fbee7c83dd8", "type": "github" }, "original": { @@ -24,15 +24,15 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1747046372, - "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", - "owner": "edolstra", + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", "type": "github" }, "original": { - "owner": "edolstra", + "owner": "NixOS", "repo": "flake-compat", "type": "github" } @@ -42,11 +42,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1754487366, - "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", "type": "github" }, "original": { @@ -64,11 +64,11 @@ ] }, "locked": { - "lastModified": 1755446520, - "narHash": "sha256-I0Ok1OGDwc1jPd8cs2VvAYZsHriUVFGIUqW+7uSsOUM=", + "lastModified": 1778507602, + "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "4b04db83821b819bbbe32ed0a025b31e7971f22e", + "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a", "type": "github" }, "original": { @@ -100,11 +100,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1755186698, - "narHash": "sha256-wNO3+Ks2jZJ4nTHMuks+cxAiVBGNuEBXsT29Bz6HASo=", + "lastModified": 1778869304, + "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fbcf476f790d8a217c3eab4e12033dc4a0f6d23c", + "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", "type": "github" }, "original": { @@ -116,11 +116,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1753579242, - "narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=", + "lastModified": 1777168982, + "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e", + "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", "type": "github" }, "original": { @@ -140,11 +140,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1755504847, - "narHash": "sha256-VX0B9hwhJypCGqncVVLC+SmeMVd/GAYbJZ0MiiUn2Pk=", + "lastModified": 1779074864, + "narHash": "sha256-0M3WqsWmtXmv9Ev/vnFfCHosWvISDwiuuhQ104UO3CI=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "a905e3b21b144d77e1b304e49f3264f6f8d4db75", + "rev": "cdfe408d4b436e806ff525cb3e67588a6a009ed1", "type": "github" }, "original": { From 9dbea188580bdfa7653838667bf25c0582b1c5cb Mon Sep 17 00:00:00 2001 From: Vinicius Deolindo Date: Tue, 19 May 2026 00:37:19 -0300 Subject: [PATCH 4/5] flake: stop using `fenix` this makes the flake smaller and way faster to build. --- flake.lock | 39 --------------------------------------- flake.nix | 46 +++++++++------------------------------------- 2 files changed, 9 insertions(+), 76 deletions(-) diff --git a/flake.lock b/flake.lock index 3ff57f183..85acabe5e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,26 +1,5 @@ { "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1779099656, - "narHash": "sha256-x+PMKsZHKbgNbWrkyNP58xb4LrQfzzFd0QJVnPc+VnY=", - "owner": "nix-community", - "repo": "fenix", - "rev": "f553608656def48a8aa2984b85f27fbee7c83dd8", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-compat": { "flake": false, "locked": { @@ -131,28 +110,10 @@ }, "root": { "inputs": { - "fenix": "fenix", "flake-parts": "flake-parts", "git-hooks": "git-hooks", "nixpkgs": "nixpkgs" } - }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1779074864, - "narHash": "sha256-0M3WqsWmtXmv9Ev/vnFfCHosWvISDwiuuhQ104UO3CI=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "cdfe408d4b436e806ff525cb3e67588a6a009ed1", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 0274b30f1..8f460ebdb 100644 --- a/flake.nix +++ b/flake.nix @@ -4,11 +4,6 @@ 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 = { @@ -36,15 +31,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; @@ -54,27 +42,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; }; }; @@ -85,14 +60,11 @@ cmake protobuf - (rustToolchain.withComponents [ - "cargo" - "clippy" - "rust-src" - "rustc" - "rustfmt" - "rust-analyzer" - ]) + cargo + clippy + rustc + rustfmt + rust-analyzer ]; hardeningDisable = [ "fortify" ]; From 0692cf27cae268d6fb7ab4748e7aea60c862eacf Mon Sep 17 00:00:00 2001 From: Vinicius Deolindo Date: Tue, 19 May 2026 00:43:51 -0300 Subject: [PATCH 5/5] flake: touch ups --- flake.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 8f460ebdb..6540e332a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +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"; git-hooks = { url = "github:cachix/git-hooks.nix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - }; + inputs.nixpkgs.follows = "nixpkgs"; }; };