Repository navigation
feat(shell): add psql and pinned nvm via Home Manager - #25
Merged
Merged
Conversation
Install postgresql to provide psql, and pin nvm v0.40.8 through fetchFromGitHub since nvm is not packaged in nixpkgs. The pinned scripts are symlinked read-only into ~/.local/share/nvm-sh, while NVM_DIR points at a writable ~/.nvm so installed Node versions work. AI-Reasoning: https://github.com/menil/dotfiles/blob/ai-reasoning/feat-psql-nvm.md
There was a problem hiding this comment.
Code Review Summary
Needs Attention (0 issues)
Suggestions (1 items)
- [Maintainability] Use nixpkgs nvm wrapper (LOW impact, LOW effort)
While the author mentions nvm is not packaged, many modern nixpkgs versions providepkgs.nvm. It may be worth double-checking the channel version to avoid manual pinning of the GitHub source.
All Clear
- Correctness & Logic
- Static Analysis & Types
- Security
- Quality & Style
- Performance
- PII Detection
Verdict: Ready to Merge
The implementation correctly handles the read-only nature of the Nix store by separating the nvm scripts from the writable NVM_DIR.
Owner
Author
|
Thanks for the review. I checked the nixpkgs revision pinned in flake.lock for aarch64-darwin and it has no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
postgresqltohome.packagessopsqlis available.pkgs.fetchFromGitHub, since it is not packaged in nixpkgs or Home Manager, and expose it through a stable symlink at~/.local/share/nvm-sh..zshrc, setNVM_DIR=~/.nvm(writable, created on demand) and sourcenvm.shandbash_completionfrom the pinned symlink.Why this shape
The pinned nvm scripts live in the read-only Nix store, so installed Node versions need a separate writable
NVM_DIR. The stable symlink keeps.zshrcindependent of the store hash. Sourcing is guarded so shells start cleanly before the profile is activated.Files
modules/shell.nix:postgresqlpackage,nvmSrcpin,home.filesymlinksrc/home/.zshrc:NVM_DIRsetup and nvm sourcingValidation
nix-shell --run "just validate"passes (shellcheck, markdownlint, statix,nix flake check, nixpkgs-fmt, shfmt).