Compare commits

..

1 commit

Author SHA1 Message Date
f830613ded
Add pre-commit hooks for nixfmt, deadnix, and statix
Also, exclude .pre-commit-config.yaml from SOPS processing
2026-03-14 01:21:41 -04:00
6 changed files with 9 additions and 15 deletions

1
.gitattributes vendored
View file

@ -1,3 +1,2 @@
*.yaml diff=sopsdiffer
.pre-commit-config.yaml diff=default

View file

@ -18,10 +18,10 @@ jobs:
run: nix flake show
- name: Check formatting
run: nix fmt -- --ci .
run: nix fmt --check .
- name: Run deadnix
run: nix run nixpkgs#deadnix ./modules ./lib
run: deadnix ./modules ./lib
- name: Run statix
run: nix run nixpkgs#statix check -- .
run: statix check ./modules ./lib

View file

@ -3,11 +3,11 @@ repos:
hooks:
- id: nixfmt
name: nixfmt
entry: nix
entry: nixfmt
language: system
types: [nix]
pass_filenames: false
args: ["fmt"]
args: ["."]
- id: deadnix
name: deadnix
@ -16,10 +16,3 @@ repos:
types: [nix]
args: ["./modules", "./lib"]
- id: statix
name: statix
entry: statix
language: system
types: [nix]
args: ["check", "--", "."]

View file

@ -60,6 +60,8 @@ creation_rules:
key_groups:
- age:
- *system_rainbow_planet
- path_regex: ^\.pre-commit-config\.yaml$
# Plain YAML file, not encrypted
- path_regex: modules/shared/secrets.yaml$
key_groups:
- age:

View file

@ -100,7 +100,7 @@
];
in
{
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-tree);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt);
# Darwin (macOS) hosts
darwinConfigurations = {

View file

@ -51,7 +51,7 @@ in
nodejs
nurl
nvd
nixfmt-tree
nixfmt
onefetch
powershell
pre-commit