-
Notifications
You must be signed in to change notification settings - Fork 3
chore(nix): migrate lefthook from npm to nix #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Move lefthook from pnpm devDependencies to nix flake buildInputs. This ensures consistent versioning across the team via nix and automatically installs git hooks when entering the devshell. Changes: - Add lefthook to flake.nix buildInputs - Add `lefthook install` to shellHook for automatic setup - Remove lefthook from package.json devDependencies - Remove lefthook from pnpm-workspace.yaml catalog and onlyBuiltDependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 4 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="flake.nix">
<violation number="1" location="flake.nix:55">
P2: `lefthook install` redirects stderr to `/dev/null`, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| fi | ||
| # Install lefthook git hooks | ||
| lefthook install > /dev/null 2>&1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: lefthook install redirects stderr to /dev/null, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At flake.nix, line 55:
<comment>`lefthook install` redirects stderr to `/dev/null`, so hook-install failures are silent and the devshell keeps running without required hooks. Let stderr surface (or explicitly handle failures) so developers notice problems.</comment>
<file context>
@@ -47,6 +50,9 @@
fi
+
+ # Install lefthook git hooks
+ lefthook install > /dev/null 2>&1
'';
};
</file context>
| lefthook install > /dev/null 2>&1 | |
| lefthook install > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the lefthook git hooks manager from being an npm package (managed via pnpm) to being provided through the Nix flake development environment. This change ensures consistent tooling across the development team by leveraging Nix's reproducible environment management.
Changes:
- Removed lefthook from pnpm dependencies (package.json, pnpm-workspace.yaml, and pnpm-lock.yaml)
- Added lefthook to Nix flake buildInputs and configured automatic git hooks installation via shellHook
- All lefthook platform-specific binaries removed from lockfile (darwin, linux, windows, freebsd, openbsd variants)
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| flake.nix | Added lefthook to buildInputs and added automatic installation in shellHook |
| package.json | Removed lefthook from devDependencies catalog reference |
| pnpm-workspace.yaml | Removed lefthook from dev catalog and onlyBuiltDependencies list |
| pnpm-lock.yaml | Removed all lefthook package entries including platform-specific binaries |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install lefthook git hooks | ||
| lefthook install > /dev/null 2>&1 |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error suppression for the lefthook install command may hide important installation failures. If lefthook fails to install git hooks (e.g., due to permissions issues or missing configuration), developers won't be notified. Consider either:
- Allowing errors to display so developers can see if something goes wrong
- Adding a conditional check to verify the installation succeeded
- At minimum, only suppressing stdout while keeping stderr visible:
lefthook install > /dev/null
| # Install lefthook git hooks | |
| lefthook install > /dev/null 2>&1 | |
| # Install lefthook git hooks (suppress stdout but keep stderr visible) | |
| lefthook install > /dev/null |
Summary
Migrates lefthook from pnpm devDependencies to nix flake for consistent tooling across the team.
What Changed
flake.nixbuildInputslefthook installto shellHook for automatic git hooks setup on devshell entrypackage.jsondevDependenciespnpm-workspace.yamlcatalog andonlyBuiltDependenciesSummary by cubic
Migrated Lefthook from pnpm to the Nix flake for consistent versions and simpler setup. Git hooks now auto-install when entering the devshell.
Refactors
lefthook install.Migration
nix developto get hooks installed; pnpm no longer manages lefthook.lefthook install.Written for commit bd7d7f0. Summary will update on new commits.