File tree Expand file tree Collapse file tree 4 files changed +20
-28
lines changed
Expand file tree Collapse file tree 4 files changed +20
-28
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,16 @@ nix-cabal-repl:
3333
3434# Target to use as dependency to fail if not inside nix-shell.
3535requires_nix_shell :
36- @ [ " ( $ IN_NIX_SHELL )" ] || echo " The $( MAKECMDGOALS) target must be run from inside ` nix develop ` "
37- @ [ " ( $ IN_NIX_SHELL )" ] || (echo " run ` nix develop` first" && false)
36+ @ [ " $( IN_NIX_SHELL) " ] || echo " The $( MAKECMDGOALS) target must be run from inside a nix shell "
37+ @ [ " $( IN_NIX_SHELL) " ] || (echo " run ' nix develop' first" && false)
3838
3939# Add folder locations to the list to be reformatted.
4040fourmolu-format :
4141 @ echo " > Formatting all .hs files"
4242 fourmolu -i $$(find src/ -iregex ".*.hs" )
4343 fourmolu -i $$(find test/ -iregex ".*.hs" )
44+
45+ NIX_SOURCES := $(shell git ls-tree -r HEAD --full-tree --name-only | grep -E '.* \.nix' )
46+
47+ nixfmt : requires_nix_shell
48+ nixfmt $(NIX_SOURCES )
Original file line number Diff line number Diff line change 1- (
2- import (
3- let
4- lock = builtins . fromJSON ( builtins . readFile ./flake.lock ) ;
5- in
6- fetchTarball {
7- url = "https://github.com/edolstra/flake-compat/archive/${ lock . nodes . flake-compat . locked . rev } .tar.gz" ;
8- sha256 = lock . nodes . flake-compat . locked . narHash ;
9- }
10- ) {
11- src = ./. ;
12- }
13- ) . defaultNix
1+ ( import ( let lock = builtins . fromJSON ( builtins . readFile ./flake.lock ) ;
2+ in fetchTarball {
3+ url =
4+ "https://github.com/edolstra/flake-compat/archive/${ lock . nodes . flake-compat . locked . rev } .tar.gz" ;
5+ sha256 = lock . nodes . flake-compat . locked . narHash ;
6+ } ) { src = ./. ; } ) . defaultNix
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ pkgs.haskell-nix.cabalProject {
7979 entr
8080 ghcid
8181 git
82+ nixfmt
8283
8384 # hls doesn't support preprocessors yet so this has to exist in PATH
8485 haskellPackages . record-dot-preprocessor
Original file line number Diff line number Diff line change 1- (
2- import (
3- let
4- lock = builtins . fromJSON ( builtins . readFile ./flake.lock ) ;
5- in
6- fetchTarball {
7- url = "https://github.com/edolstra/flake-compat/archive/${ lock . nodes . flake-compat . locked . rev } .tar.gz" ;
8- sha256 = lock . nodes . flake-compat . locked . narHash ;
9- }
10- ) {
11- src = ./. ;
12- }
13- ) . shellNix . default
1+ ( import ( let lock = builtins . fromJSON ( builtins . readFile ./flake.lock ) ;
2+ in fetchTarball {
3+ url =
4+ "https://github.com/edolstra/flake-compat/archive/${ lock . nodes . flake-compat . locked . rev } .tar.gz" ;
5+ sha256 = lock . nodes . flake-compat . locked . narHash ;
6+ } ) { src = ./. ; } ) . shellNix . default
You can’t perform that action at this time.
0 commit comments