chore: add treefmt and format files

This commit is contained in:
technofab 2024-09-13 17:21:32 +02:00
parent f30adf88d3
commit 97f49cbdf6
4 changed files with 67 additions and 55 deletions

View file

@ -7,6 +7,7 @@
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.devenv.flakeModule
inputs.treefmt-nix.flakeModule
./lib/flakeModule.nix
];
systems = import systems;
@ -14,16 +15,27 @@
perSystem = {
pkgs,
inputs',
config,
...
}: rec {
formatter = pkgs.alejandra;
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
mdformat.enable = true;
yamlfmt.enable = true;
};
};
devenv.shells.default = {
containers = pkgs.lib.mkForce {};
packages = with pkgs; [dive skopeo];
pre-commit = {
hooks = {
alejandra.enable = true;
treefmt = {
enable = true;
packageOverrides.treefmt = config.treefmt.build.wrapper;
};
};
};
};
@ -157,6 +169,7 @@
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
treefmt-nix.url = "github:numtide/treefmt-nix";
attic = {
url = "gitlab:TECHNOFAB/attic";
inputs.nixpkgs.follows = "nixpkgs";