aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-13 06:22:58 -0700
committerFuwn <[email protected]>2024-09-13 06:22:58 -0700
commitc2be2bd8b096c3cf506bf889d586ff4aaf5d0a8f (patch)
tree6a1543121d5181d265d332fcd3daa16cc5a9824d
parentb2689036f2e9182a219061f5abd156314d852e82 (diff)
downloadpywal.nix-c2be2bd8b096c3cf506bf889d586ff4aaf5d0a8f.tar.xz
pywal.nix-c2be2bd8b096c3cf506bf889d586ff4aaf5d0a8f.zip
chore(flake): add git hooks and checks
-rw-r--r--.gitignore1
-rw-r--r--flake.nix19
2 files changed, 20 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index bee8a64..b7c1740 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
__pycache__
+.pre-commit-config.yaml
diff --git a/flake.nix b/flake.nix
index 892f076..3b1802f 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,8 +17,10 @@
outputs =
{
+ self,
nixpkgs,
flake-utils,
+ pre-commit-hooks,
...
}:
flake-utils.lib.eachDefaultSystem (system: {
@@ -152,5 +154,22 @@
};
formatter = nixpkgs.legacyPackages."${system}".nixfmt-rfc-style;
+
+ checks.pre-commit-check = pre-commit-hooks.lib.${system}.run {
+ src = ./.;
+
+ hooks = {
+ deadnix.enable = true;
+ flake-checker.enable = true;
+ nixfmt-rfc-style.enable = true;
+ statix.enable = true;
+ };
+ };
+
+ devShells.default = nixpkgs.legacyPackages.${system}.mkShell {
+ inherit (self.checks.${system}.pre-commit-check) shellHook;
+
+ buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
+ };
});
}