diff options
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/README.md | 9 | ||||
| -rw-r--r-- | dev/checks.nix | 42 | ||||
| -rw-r--r-- | dev/default.nix | 8 | ||||
| -rw-r--r-- | dev/treefmt.nix | 19 |
4 files changed, 25 insertions, 53 deletions
diff --git a/dev/README.md b/dev/README.md index f16f659..ac255bc 100644 --- a/dev/README.md +++ b/dev/README.md @@ -1,9 +1,5 @@ # ./dev/ -## checks.nix - -Runs all of my favorite tools on the code here to make sure it's good to go - ## devShells.nix A misnomer - this only contains one shell @@ -12,3 +8,8 @@ A misnomer - this only contains one shell Jobs I want to run in CI. Currently built by [`nix-fast-build`](https://github.com/Mic92/nix-fast-build) + +## treefmt.nix + +[treefmt](https://github.com/numtide/treefmt) configuration via +[treefmt-nix](https://github.com/numtide/treefmt-nix) diff --git a/dev/checks.nix b/dev/checks.nix deleted file mode 100644 index 56c5038..0000000 --- a/dev/checks.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - perSystem = - { pkgs, ... }: - { - checks = { - check-formatting = - pkgs.runCommand "check-formatting" { nativeBuildInputs = [ pkgs.nixfmt-rfc-style ]; } - '' - cd ${./.} - - echo "running nixfmt..." - nixfmt --check . - - touch $out - ''; - - check-lint = - pkgs.runCommand "check-lint" - { - nativeBuildInputs = [ - pkgs.actionlint - pkgs.deadnix - pkgs.statix - ]; - } - '' - cd ${./.} - - echo "running actionlint..." - actionlint ./.github/workflows/* - - echo "running deadnix..." - deadnix --fail - - echo "running statix..." - statix check . - - touch $out - ''; - }; - }; -} diff --git a/dev/default.nix b/dev/default.nix index 105273c..d1a371e 100644 --- a/dev/default.nix +++ b/dev/default.nix @@ -1,13 +1,7 @@ { imports = [ - ./checks.nix ./devShells.nix ./hydraJobs.nix + ./treefmt.nix ]; - - perSystem = - { pkgs, ... }: - { - formatter = pkgs.nixfmt-rfc-style; - }; } diff --git a/dev/treefmt.nix b/dev/treefmt.nix new file mode 100644 index 0000000..9029cf0 --- /dev/null +++ b/dev/treefmt.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: +{ + imports = [ inputs.treefmt-nix.flakeModule ]; + + perSystem = { + treefmt = { + projectRootFile = ".git/config"; + + # TODO: add actionlint + # https://github.com/numtide/treefmt-nix/pull/146 + programs = { + deadnix.enable = true; + just.enable = true; + nixfmt-rfc-style.enable = true; + statix.enable = true; + }; + }; + }; +} |
