File tree Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Expand file tree Collapse file tree 2 files changed +89
-0
lines changed Original file line number Diff line number Diff line change 22 inputs = {
33 nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
44 flake-utils . url = "github:numtide/flake-utils" ;
5+ gitignore = {
6+ url = "github:hercules-ci/gitignore.nix" ;
7+ inputs . nixpkgs . follows = "nixpkgs" ;
8+ } ;
59 treefmt-nix = {
610 url = "github:numtide/treefmt-nix" ;
711 inputs . nixpkgs . follows = "nixpkgs" ;
1014 url = "github:oxalica/rust-overlay" ;
1115 inputs . nixpkgs . follows = "nixpkgs" ;
1216 } ;
17+ pre-commit-hooks = {
18+ url = "github:cachix/pre-commit-hooks.nix" ;
19+ inputs = {
20+ nixpkgs . follows = "nixpkgs" ;
21+ gitignore . follows = "gitignore" ;
22+ } ;
23+ } ;
1324 } ;
1425
1526 outputs =
1627 {
1728 nixpkgs ,
1829 flake-utils ,
30+ pre-commit-hooks ,
1931 rust-overlay ,
2032 treefmt-nix ,
2133 ...
6375 } ;
6476 } ) . config . build . wrapper ;
6577
78+ pre-commit-check = pre-commit-hooks . lib . ${ system } . run {
79+ src = ./. ;
80+
81+ hooks = {
82+ deadnix . enable = true ;
83+ nixfmt-rfc-style . enable = true ;
84+ treefmt = {
85+ enable = true ;
86+ package = room-formatter ;
87+ } ;
88+ } ;
89+ } ;
90+
6691 packages . default = rustPlatform . buildRustPackage rec {
6792 name = "room" ;
6893 src = ./. ;
83108 {
84109 inherit packages ;
85110
111+ checks = { inherit pre-commit-check ; } ;
112+
86113 devShells . default = mkShell {
87114 name = "room" ;
88115
You can’t perform that action at this time.
0 commit comments