|
15 | 15 | inputs = { |
16 | 16 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; |
17 | 17 | flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; |
18 | | - devenv.url = "github:cachix/devenv"; |
| 18 | + # TODO - Use upstream once https://github.com/cachix/git-hooks.nix/pull/396 is merged |
| 19 | + git-hooks = { url = "github:mrcjkb/git-hooks.nix/clippy"; inputs.nixpkgs.follows = "nixpkgs"; }; |
| 20 | + devenv = { url = "github:cachix/devenv"; inputs.git-hooks.follows = "git-hooks"; }; |
19 | 21 | fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; |
20 | 22 | crane = { url = "github:ipetkov/crane"; }; |
21 | 23 | nci = { url = "github:yusdacra/nix-cargo-integration"; inputs = { nixpkgs.follows = "nixpkgs"; parts.follows = "flake-parts"; crane.follows = "crane"; }; }; |
|
124 | 126 | cargo = rustToolchain; |
125 | 127 | clippy = rustToolchain; |
126 | 128 | }; |
| 129 | + extraPackages = [ |
| 130 | + pkgs.openssl |
| 131 | + pkgs.pkg-config |
| 132 | + ]; |
127 | 133 | }; |
128 | 134 |
|
129 | 135 | rustfmt = { |
|
134 | 140 | }; |
135 | 141 | }; |
136 | 142 | }; |
| 143 | + |
| 144 | + settings.rust.check.cargoDeps = pkgs.rustPlatform.importCargoLock { |
| 145 | + lockFile = ./Cargo.lock; |
| 146 | + allowBuiltinFetchGit = true; |
| 147 | + }; |
137 | 148 | }; |
138 | 149 | }; |
139 | 150 |
|
|
225 | 236 | }))) |
226 | 237 | ]); |
227 | 238 |
|
228 | | - # TODO - Refactor once https://github.com/cachix/git-hooks.nix/pull/396 is merged |
229 | | - checks.pre-commit = |
230 | | - let |
231 | | - inherit (config.devenv.shells.default) git-hooks; |
232 | | - in |
233 | | - pkgs.stdenv.mkDerivation { |
234 | | - name = "pre-commit-run"; |
235 | | - src = git-hooks.rootSrc; |
236 | | - buildInputs = [ pkgs.git pkgs.openssl pkgs.pkg-config ]; |
237 | | - nativeBuildInputs = [ pkgs.rustPlatform.cargoSetupHook ]; |
238 | | - cargoDeps = pkgs.rustPlatform.importCargoLock { |
239 | | - lockFile = ./Cargo.lock; |
240 | | - allowBuiltinFetchGit = true; |
241 | | - }; |
242 | | - buildPhase = git-hooks.run.buildCommand; |
243 | | - }; |
| 239 | + checks.pre-commit = config.devenv.shells.default.git-hooks.run; |
244 | 240 | }; |
245 | 241 | }; |
246 | 242 | } |
0 commit comments