diff options
| author | seth <[email protected]> | 2024-02-28 07:41:37 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-28 07:41:37 -0500 |
| commit | e969914eae2c0b665f84b672f2651dbe334d1fad (patch) | |
| tree | 938179212893538b78c5fb2363056b789beb63bd | |
| parent | 4caa14d0416c8ac14e0ac617a1eec22b9df830f6 (diff) | |
flake: start using treefmt-nix
| -rw-r--r-- | flake.lock | 14 | ||||
| -rw-r--r-- | flake.nix | 34 |
2 files changed, 36 insertions, 12 deletions
@@ -529,7 +529,8 @@ "openwrt-imagebuilder": "openwrt-imagebuilder", "pre-commit": "pre-commit", "teawiebot": "teawiebot", - "terranix": "terranix" + "terranix": "terranix", + "treefmt-nix": "treefmt-nix" } }, "rust-analyzer-src": { @@ -603,7 +604,9 @@ "pre-commit" ], "procfile-nix": "procfile-nix", - "treefmt-nix": "treefmt-nix" + "treefmt-nix": [ + "treefmt-nix" + ] }, "locked": { "lastModified": 1708356801, @@ -649,16 +652,15 @@ "treefmt-nix": { "inputs": { "nixpkgs": [ - "teawiebot", "nixpkgs" ] }, "locked": { - "lastModified": 1707300477, - "narHash": "sha256-qQF0fEkHlnxHcrKIMRzOETnRBksUK048MXkX0SOmxvA=", + "lastModified": 1708897213, + "narHash": "sha256-QECZB+Hgz/2F/8lWvHNk05N6NU/rD9bWzuNn6Cv8oUk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "ac599dab59a66304eb511af07b3883114f061b9d", + "rev": "e497a9ddecff769c2a7cbab51e1ed7a8501e7a3a", "type": "github" }, "original": { @@ -20,6 +20,7 @@ ./ext # nix expressions for *external*, not so nix-y things inputs.pre-commit.flakeModule + inputs.treefmt-nix.flakeModule # dogfooding flakeModules.configurations @@ -42,11 +43,28 @@ self', ... }: { - pre-commit = { - settings.hooks = { - actionlint.enable = true; - ${self'.formatter.pname}.enable = true; + treefmt = { + projectRootFile = "flake.nix"; + + programs = { + alejandra.enable = true; deadnix.enable = true; + prettier.enable = true; + }; + + settings.global = { + excludes = [ + "./flake.lock" + ]; + }; + }; + + pre-commit.settings = { + settings.treefmt.package = config.treefmt.build.wrapper; + + hooks = { + actionlint.enable = true; + treefmt.enable = true; nil.enable = true; statix.enable = true; }; @@ -75,8 +93,6 @@ ++ lib.optionals stdenv.isLinux [nixos-rebuild inputs'.agenix.packages.agenix]; }; - formatter = pkgs.alejandra; - packages.ciGate = let ci = self.lib.ci [system]; @@ -214,6 +230,7 @@ nixpkgs.follows = "nixpkgs"; flake-parts.follows = "flake-parts"; pre-commit-hooks-nix.follows = "pre-commit"; + treefmt-nix.follows = "treefmt-nix"; }; }; @@ -227,5 +244,10 @@ bats-assert.follows = ""; }; }; + + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } |
