diff --git a/flake.lock b/flake.lock index 9d5cc8b8..50ba38ac 100644 --- a/flake.lock +++ b/flake.lock @@ -118,6 +118,55 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-stable": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731363552, + "narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gnome-shell": { "flake": false, "locked": { @@ -180,6 +229,7 @@ "base16-vim": "base16-vim", "flake-compat": "flake-compat", "flake-utils": "flake-utils", + "git-hooks": "git-hooks", "gnome-shell": "gnome-shell", "home-manager": "home-manager", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 42eee31b..66e1ee1a 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,16 @@ url = "github:numtide/flake-utils"; }; + git-hooks = { + inputs = { + flake-compat.follows = "flake-compat"; + nixpkgs-stable.follows = "git-hooks/nixpkgs"; + nixpkgs.follows = "nixpkgs"; + }; + + url = "github:cachix/git-hooks.nix"; + }; + gnome-shell = { flake = false; @@ -86,6 +96,15 @@ inherit (nixpkgs) lib; pkgs = nixpkgs.legacyPackages.${system}; in { + checks.git-hooks = inputs.git-hooks.lib.${system}.run { + hooks = { + deadnix.enable = true; + statix.enable = true; + }; + + src = ./.; + }; + devShells.default = pkgs.mkShell { packages = [ inputs.home-manager.packages.${system}.default ]; };