diff --git a/rust/flake.nix b/rust/flake.nix index 6fa9cdb..a133586 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -93,6 +93,29 @@ { formatter = forSystems ({ pkgs, ... }: pkgs.alejandra); + checks = forSystems ( + { pkgs, fenixChannel, ... }: + { + rustfmt = + pkgs.runCommand "check-rustfmt" + { + nativeBuildInputs = + let + fenixRustToolchain = fenixChannel.withComponents [ + "cargo" + "rustfmt-preview" + ]; + in + [ fenixRustToolchain ]; + } + '' + cd ${./.} + cargo fmt -- --check + touch $out + ''; + } + ); + packages = forSystems ( { pkgs,