File tree 4 files changed +20
-28
lines changed
4 files changed +20
-28
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,16 @@ nix-cabal-repl:
33
33
34
34
# Target to use as dependency to fail if not inside nix-shell.
35
35
requires_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)
38
38
39
39
# Add folder locations to the list to be reformatted.
40
40
fourmolu-format :
41
41
@ echo " > Formatting all .hs files"
42
42
fourmolu -i $$(find src/ -iregex ".*.hs" )
43
43
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 @@ -73,6 +73,7 @@ pkgs.haskell-nix.cabalProject {
73
73
entr
74
74
ghcid
75
75
git
76
+ nixfmt
76
77
77
78
# hls doesn't support preprocessors yet so this has to exist in PATH
78
79
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