try fufexans git hooks setup
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
.direnv
|
.direnv
|
||||||
|
.pre-commit-config.yaml
|
||||||
result*
|
result*
|
||||||
|
|||||||
14
flake.nix
14
flake.nix
@@ -9,6 +9,7 @@
|
|||||||
./users
|
./users
|
||||||
./hosts
|
./hosts
|
||||||
./modules
|
./modules
|
||||||
|
./fmt-hooks.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem = {pkgs, ...}: {
|
perSystem = {pkgs, ...}: {
|
||||||
@@ -105,6 +106,19 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
git-hooks = {
|
||||||
|
url = "github:cachix/git-hooks.nix";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
flake-compat.follows = "flake-compat";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
treefmt-nix = {
|
||||||
|
url = "github:numtide/treefmt-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# Custom
|
# Custom
|
||||||
tuirun = {
|
tuirun = {
|
||||||
url = "git+https://git.sr.ht/~canasta/tuirun";
|
url = "git+https://git.sr.ht/~canasta/tuirun";
|
||||||
|
|||||||
26
fmt-hooks.nix
Normal file
26
fmt-hooks.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.git-hooks.flakeModule
|
||||||
|
inputs.treefmt-nix.flakeModule
|
||||||
|
];
|
||||||
|
|
||||||
|
perSystem = {
|
||||||
|
pre-commit.settings = {
|
||||||
|
excludes = ["flake.lock"];
|
||||||
|
hooks.treefmt.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
treefmt.programs = {
|
||||||
|
nixfmt.enable = true;
|
||||||
|
|
||||||
|
prettier = {
|
||||||
|
enable = true;
|
||||||
|
excludes = [
|
||||||
|
".js"
|
||||||
|
".md"
|
||||||
|
".ts"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
auto-format = true;
|
auto-format = true;
|
||||||
language-servers = ["nil"];
|
language-servers = ["nil"];
|
||||||
formatter = {
|
formatter = {
|
||||||
command = "${pkgs.alejandra}/bin/alejandra";
|
command = "${pkgs.nixfmt}/bin/nixfmt";
|
||||||
args = ["-q"];
|
args = ["-q"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user