File tree Expand file tree Collapse file tree 3 files changed +97
-0
lines changed Expand file tree Collapse file tree 3 files changed +97
-0
lines changed Original file line number Diff line number Diff line change 4747/* .vkey
4848/* .cert
4949
50+ .pre-commit-config.yaml
51+
5052# For now require that users generate their own hie.yaml
5153/hie.yaml
5254
Original file line number Diff line number Diff line change 1616 nixpkgs . url = "github:NixOS/nixpkgs/4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb" ;
1717 iohkNix . url = "github:input-output-hk/iohk-nix" ;
1818 flake-utils . url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs" ;
19+ pre-commit-hooks . url = "github:cachix/git-hooks.nix" ;
1920 incl . url = "github:divnix/incl" ;
2021 # non-flake nix compatibility
2122 flake-compat = {
7778 proto-js-bundle-drv = import ./nix/proto-to-js.nix { pkgs = nixpkgs ; } ;
7879 wasm-typedoc-drv = import ./nix/typedoc.nix { pkgs = nixpkgs ; } ;
7980
81+ pre-commit-check = inputs . pre-commit-hooks . lib . ${ nixpkgs . system } . run {
82+ src = ./. ;
83+ hooks = {
84+ alejandra . enable = true ;
85+ cabal-gild = {
86+ enable = true ;
87+ entry = "cabal-gild" ;
88+ files = "\\ .cabal$" ;
89+ } ;
90+ prettify = {
91+ enable = true ;
92+ entry = "scripts/githooks/haskell-style-lint" ;
93+ types = [ "haskell" ] ;
94+ } ;
95+ } ;
96+ } ;
97+
8098 # We use cabalProject' to ensure we don't build the plan for
8199 # all systems.
82100 cabalProject = nixpkgs . haskell-nix . cabalProject' ( { config , ...} : {
104122 secure: True
105123 active-repositories: hackage.haskell.org, cardano-haskell-packages-local
106124 '' ;
125+
107126 shell . packages = p : [
108127 # Packages in this repo
109128 p . cardano-api
133152 # Skip cross compilers for the shell
134153 shell . crossPlatforms = _ : [ ] ;
135154 shell . shellHook = ''
155+ export PATH="${ nixpkgs . nix } /bin:$PATH"
156+ ${ pre-commit-check . shellHook }
136157 export LD_LIBRARY_PATH="${ nixpkgs . snappy } /lib:$LD_LIBRARY_PATH"
137158 export PATH="$(git rev-parse --show-toplevel)/scripts/devshell:$PATH"
138159 '' ;
You can’t perform that action at this time.
0 commit comments