nix flake

This commit is contained in:
2026-05-28 02:23:20 +09:00
parent 1abb99aa07
commit 39935210d2
9 changed files with 1512 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
{ inputs, ... }:
{
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = _: {
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
deadnix.enable = true;
statix.enable = true;
shfmt.enable = true;
shellcheck.enable = true;
prettier.enable = true;
yamlfmt.enable = true;
taplo.enable = true;
oxfmt.enable = true;
};
settings = {
excludes = [
".git/**"
"*.lock"
".direnv/**"
"*.age"
];
};
};
};
}
+43
View File
@@ -0,0 +1,43 @@
{ inputs, ... }:
{
imports = [
inputs.git-hooks-nix.flakeModule
];
perSystem =
{
pkgs,
config,
...
}:
{
pre-commit.settings = {
hooks = {
treefmt = {
enable = true;
package = config.treefmt.build.wrapper;
};
gitleaks = {
enable = true;
name = "gitleaks";
description = "Detect hardcoded secrets";
entry = "${pkgs.gitleaks}/bin/gitleaks dir --no-banner --redact --verbose .";
pass_filenames = false;
stages = [
"pre-commit"
"pre-push"
];
};
deadnix.enable = true;
statix.enable = true;
shellcheck.enable = true;
};
};
};
}