KO
|
EN
gitlite — search
Search
#python
#java
#python3
#arduino
#golang
#machine-learning
#rust
#html
#flask
#javascript
#seismology
#nodejs
lefthook.nix
★ 14
Open GitHub ↗
Using lefthook with Nix
Download README (.md)
Explore Similar Repositories
byul
:
Write commit messages in 3 second ⭐️
nextjs-roocode-template
:
RooCode w/ Next.js template, include ESLint, Prettier, lefthook...etc
npm-package-template-ts
:
A feature-rich NPM package template for TypeScript projects.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
lefthook.nix
?
Download (.md)
# Using lefthook with Nix Easily manage git hooks with Nix, internally using lefthook. ## Usages ### Nix Flakes ```nix { description = "An example nix flake project"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; lefthook = { url = "github:sudosubin/lefthook.nix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, nixpkgs, lefthook }: let inherit (nixpkgs.lib) genAttrs platforms; forAllSystems = f: genAttrs platforms.unix (system: f (import nixpkgs { inherit system; })); in { checks = forAllSystems (pkgs: { lefthook-check = lefthook.lib.${pkgs.system}.run { src = ./.; config = { pre-commit.commands = { nixfmt = { run = "${pkgs.lib.getExe pkgs.nixfmt-rfc-style} {staged_files}"; glob = "*.nix"; }; }; }; }; }); devShells = forAllSystems (pkgs: { default = pkgs.mkShell { inherit (self.checks.${pkgs.system}.lefthook-check) shellHook; }; }); }; } ``` ## Credits This project was written with a lot of influence from [pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix).