mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 10:10:06 +01:00
chore: add treefmt and format files
This commit is contained in:
parent
f30adf88d3
commit
97f49cbdf6
4 changed files with 67 additions and 55 deletions
17
flake.nix
17
flake.nix
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue