Skip to content

Commit 08df51f

Browse files
committed
Merge branch 'master' into misha/reporting
2 parents d91cb0a + 8bd89dd commit 08df51f

File tree

4 files changed

+20
-28
lines changed

4 files changed

+20
-28
lines changed

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ nix-cabal-repl:
3333

3434
# Target to use as dependency to fail if not inside nix-shell.
3535
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)
3838

3939
# Add folder locations to the list to be reformatted.
4040
fourmolu-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)

default.nix

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
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

nix/haskell.nix

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ pkgs.haskell-nix.cabalProject {
7373
entr
7474
ghcid
7575
git
76+
nixfmt
7677

7778
# hls doesn't support preprocessors yet so this has to exist in PATH
7879
haskellPackages.record-dot-preprocessor

shell.nix

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
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

0 commit comments

Comments
 (0)