diff --git a/flake.lock b/flake.lock index c9f1b7d4..62b432a8 100644 --- a/flake.lock +++ b/flake.lock @@ -239,11 +239,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745234285, - "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b04628cb..28f35d36 100644 --- a/flake.nix +++ b/flake.nix @@ -135,13 +135,12 @@ editorconfig-checker.enable = true; hlint.enable = true; - nixfmt-rfc-style = { + treefmt = { enable = true; - settings.width = 80; + package = self.formatter.${system}; }; statix.enable = true; - stylish-haskell.enable = true; typos.enable = true; yamllint.enable = true; }; @@ -181,7 +180,8 @@ check inputs.home-manager.packages.${system}.default self.checks.${system}.git-hooks.enabledPackages - ]; + self.formatter.${system} + ] ++ self.formatter.${system}.runtimeInputs; }; ghc = pkgs.mkShell { @@ -190,6 +190,30 @@ }; }; + formatter = pkgs.treefmt.withConfig { + runtimeInputs = with pkgs; [ + nixfmt-rfc-style + stylish-haskell + ]; + + settings = { + on-unmatched = "info"; + tree-root-file = "flake.nix"; + + formatter = { + stylish-haskell = { + command = "stylish-haskell"; + includes = [ "*.hx" ]; + }; + nixfmt = { + command = "nixfmt"; + options = [ "--width=80" ]; + includes = [ "*.nix" ]; + }; + }; + }; + }; + packages = let universalPackages = {