diff --git a/flake.lock b/flake.lock index f447b8c..68b6df3 100644 --- a/flake.lock +++ b/flake.lock @@ -15,6 +15,26 @@ "type": "github" } }, + "dedupe_gitignore": { + "inputs": { + "nixpkgs": [ + "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" + } + }, "files": { "locked": { "lastModified": 1750263550, @@ -50,6 +70,32 @@ "type": "github" } }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "dedupe_flake-compat" + ], + "gitignore": [ + "dedupe_gitignore" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "import-tree": { "locked": { "lastModified": 1751399845, @@ -104,8 +150,10 @@ "root": { "inputs": { "dedupe_flake-compat": "dedupe_flake-compat", + "dedupe_gitignore": "dedupe_gitignore", "files": "files", "flake-parts": "flake-parts", + "git-hooks": "git-hooks", "import-tree": "import-tree", "make-shell": "make-shell", "nixpkgs": "nixpkgs" diff --git a/flake.nix b/flake.nix index 6f86517..4b85473 100644 --- a/flake.nix +++ b/flake.nix @@ -16,9 +16,22 @@ url = "github:nicknovitski/make-shell"; inputs.flake-compat.follows = "dedupe_flake-compat"; }; + # git-hooks ensures nix flake check is ran before commits + git-hooks = { + url = "github:cachix/git-hooks.nix"; + inputs = { + flake-compat.follows = "dedupe_flake-compat"; + nixpkgs.follows = "nixpkgs"; + gitignore.follows = "dedupe_gitignore"; + }; + }; # The following are not used but are here for deduplication. dedupe_flake-compat.url = "github:edolstra/flake-compat"; + dedupe_gitignore = { + url = "github:hercules-ci/gitignore.nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } (inputs.import-tree ./modules); diff --git a/modules/flake-parts/git-hooks.nix b/modules/flake-parts/git-hooks.nix new file mode 100644 index 0000000..8ff3255 --- /dev/null +++ b/modules/flake-parts/git-hooks.nix @@ -0,0 +1,5 @@ +{ inputs, ... }: +{ + # TODO: add to readme + imports = [ inputs.git-hooks.flakeModule ]; +}