Compare commits

..

2 commits

Author SHA1 Message Date
ea8b9efaaf
Fix action 2026-03-14 12:03:17 -04:00
0dea1aab28
Add pre-commit hooks for nixfmt, deadnix, and statix
Also, exclude .pre-commit-config.yaml from the SOPS differ
2026-03-14 11:23:11 -04:00
6 changed files with 15 additions and 9 deletions

1
.gitattributes vendored
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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