diff --git a/fix-whitespace.yaml b/fix-whitespace.yaml new file mode 100644 index 0000000..2ca3b5a --- /dev/null +++ b/fix-whitespace.yaml @@ -0,0 +1,13 @@ +included-dirs: + - src + +included-files: + - "*.agda" + - "*.md" + - "*.org" + - "*.nix" + +excluded-dirs: + - .git + - .direnv + - result diff --git a/flake.nix b/flake.nix index ff3b77e..67268aa 100644 --- a/flake.nix +++ b/flake.nix @@ -21,10 +21,22 @@ agdaWithStandardLibrary = pkgs.agda.withPackages (_: [ standard-library ]); in { - devShell = pkgs.mkShell { + checks.whitespace = pkgs.stdenvNoCC.mkDerivation { + name = "check-whitespace"; + dontBuild = true; + src = ./.; + doCheck = true; + checkPhase = '' + ${pkgs.haskellPackages.fix-whitespace}/bin/fix-whitespace --check + ''; + installPhase = ''mkdir "$out"''; + }; + + devShells.default = pkgs.mkShell { buildInputs = [ agdaWithStandardLibrary pkgs.graphviz + pkgs.haskellPackages.fix-whitespace ]; };