File tree Expand file tree Collapse file tree 4 files changed +128
-31
lines changed Expand file tree Collapse file tree 4 files changed +128
-31
lines changed Original file line number Diff line number Diff line change 1+ .pre-commit-config.yaml
12.direnv /
23coverage /
34dist /
Original file line number Diff line number Diff line change 11coverage /
22dist /
3- package-lock.json
3+ flake.lock
Original file line number Diff line number Diff line change 11{
22 description = "api-ts" ;
3-
43 inputs = {
54 nixpkgs . url = "github:nixos/nixpkgs" ;
6- flake-utils . url = "github:numtide/flake-utils" ;
5+ pre-commit-hooks = {
6+ url = "github:cachix/pre-commit-hooks.nix" ;
7+ inputs = {
8+ nixpkgs . follows = "nixpkgs" ;
9+ } ;
10+ } ;
711 } ;
812
913 outputs = {
1014 self ,
1115 nixpkgs ,
12- flake-utils ,
13- } : (
14- flake-utils . lib . eachDefaultSystem (
15- system : (
16- let
17- pkgs = nixpkgs . legacyPackages . ${ system } ;
18- in {
19- devShell = pkgs . mkShell {
20- name = "api-ts-shell" ;
16+ pre-commit-hooks ,
17+ } : let
18+ forEachSystem = nixpkgs . lib . genAttrs [
19+ "aarch64-darwin"
20+ "aarch64-linux"
21+ "x86_64-darwin"
22+ "x86_64-linux"
23+ ] ;
24+ in {
25+ checks = forEachSystem ( system : let
26+ pre-commit-check = pre-commit-hooks . lib . ${ system } . run {
27+ src = ./. ;
28+ hooks = {
29+ actionlint . enable = true ;
30+ alejandra . enable = true ;
31+ prettier . enable = true ;
32+ } ;
33+ } ;
34+ in {
35+ inherit pre-commit-check ;
36+ } ) ;
2137
22- packages = with pkgs ; [
23- nodejs
24- ] ;
38+ devShells = forEachSystem ( system : let
39+ pkgs = nixpkgs . legacyPackages . ${ system } ;
40+ in {
41+ default = pkgs . mkShell {
42+ packages = with pkgs ; [
43+ nodejs
44+ ] ;
2545
26- shellHook = ''
27- export PATH="$(pwd)/node_modules/.bin:$PATH"
28- '' ;
29- } ;
30- }
31- )
32- )
33- ) ;
46+ shellHook = ''
47+ ${ self . checks . ${ system } . pre-commit-check . shellHook }
48+ export PATH="$(pwd)/node_modules/.bin:$PATH"
49+ '' ;
50+ } ;
51+ } ) ;
52+ } ;
3453}
You can’t perform that action at this time.
0 commit comments