chore: sync chore-v2 branch with main - #397
Conversation
fix(brew-upgrader): specify full path for brew upgrade command
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds a Neovim plugin lock entry and two Git-related plugins with keymaps, adds Makefile launchctl targets and makes Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request synchronizes the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Mesa DescriptionTL;DRSyncs What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request syncs changes from the chore-v2 branch, adding the fff.nvim plugin and modifying the Homebrew upgrade script. The plugin addition is straightforward. However, the script modification hardcodes the path to the brew executable, making it non-portable between Apple Silicon and Intel Macs. I've included a suggestion to dynamically locate the brew executable for better portability.
| set -euo pipefail | ||
|
|
||
| brew upgrade | ||
| /opt/homebrew/bin/brew upgrade |
There was a problem hiding this comment.
Hardcoding the path to the brew executable to /opt/homebrew/bin/brew makes this script specific to Apple Silicon Macs and will cause it to fail on Intel-based Macs where Homebrew is typically installed in /usr/local/bin. To make the script more portable across different architectures, it's better to dynamically determine the path to the brew executable.
| /opt/homebrew/bin/brew upgrade | |
| if [ -x "/opt/homebrew/bin/brew" ]; then | |
| /opt/homebrew/bin/brew upgrade | |
| elif [ -x "/usr/local/bin/brew" ]; then | |
| /usr/local/bin/brew upgrade | |
| else | |
| echo "Error: Homebrew not found" >&2 | |
| exit 1 | |
| fi |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
home-manager/programs/neovim/nvim-pack-lock.json(1 hunks)home-manager/services/brew-upgrader/upgrade.sh(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,ts,jsx,tsx,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Use Biome with 2-space indentation, 80-character line width, double quotes, and trailing commas (ES5) for JSON/JavaScript/TypeScript files
Files:
home-manager/programs/neovim/nvim-pack-lock.json
**/*.{json,yaml,yml,toml}
📄 CodeRabbit inference engine (.cursor/rules/formatting.mdc)
**/*.{json,yaml,yml,toml}: Use consistent indentation (2 spaces) in configuration files
Sort keys alphabetically when possible in configuration files
Use clear, descriptive names in configuration files
Files:
home-manager/programs/neovim/nvim-pack-lock.json
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (.cursor/rules/formatting.mdc)
**/*.{js,jsx,ts,tsx,json}: Format JavaScript/TypeScript/JSON files using Biome with 2-space indentation and 80 character line width
Enable Biome linter with recommended rules for JavaScript/TypeScript/JSON files
Files:
home-manager/programs/neovim/nvim-pack-lock.json
**/*.{js,jsx,ts,tsx,json,jsonc,md}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Use Biome for code formatting as configured in biome.json
Files:
home-manager/programs/neovim/nvim-pack-lock.json
**/*.{sh,bash}
📄 CodeRabbit inference engine (CLAUDE.md)
Use shfmt with 2-space indentation for shell scripts
**/*.{sh,bash}: Use 2 spaces for indentation in shell scripts
Add proper shebang lines to shell scripts
Follow shellcheck recommendations in shell scripts
Document complex commands in shell scripts
Use consistent variable naming in shell scripts
Files:
home-manager/services/brew-upgrader/upgrade.sh
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: Mesa Review
- GitHub Check: Agent
- GitHub Check: cubic · AI code reviewer
- GitHub Check: nix-nixos
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: nix-linux
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: nix-darwin
- GitHub Check: lua-neovim-test
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: lua-hammerspoon
- GitHub Check: lua-neovim
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
🔇 Additional comments (1)
home-manager/programs/neovim/nvim-pack-lock.json (1)
68-71: Plugin entry is properly formatted and positioned.The
fff.nvimentry is correctly placed in alphabetical order, maintains consistent 2-space indentation, and follows the established lock file structure. The entry looks good.
| set -euo pipefail | ||
|
|
||
| brew upgrade | ||
| /opt/homebrew/bin/brew upgrade |
There was a problem hiding this comment.
Homebrew path is hardcoded to Apple Silicon Macs only.
The absolute path /opt/homebrew/bin/brew only works on Apple Silicon Macs. Intel Macs use /usr/local/bin/brew, and the script will fail silently on unsupported architectures due to set -e. This breaks portability.
Consider using a more robust approach that detects the correct Homebrew path:
-/opt/homebrew/bin/brew upgrade
+if command -v brew &> /dev/null; then
+ brew upgrade
+else
+ echo "Error: brew not found in PATH" >&2
+ exit 1
+fiAlternatively, if the script is intentionally Apple Silicon-only, document this constraint clearly in a comment or README.
🤖 Prompt for AI Agents
In home-manager/services/brew-upgrader/upgrade.sh around line 5, the script
hardcodes /opt/homebrew/bin/brew which only exists on Apple Silicon and will
fail on Intel Macs; replace the hardcoded path with logic that locates Homebrew
dynamically (e.g., use command -v brew or check common locations like
/opt/homebrew/bin/brew and /usr/local/bin/brew) and fail with a clear error if
not found, or if the script is intended to be Apple Silicon–only, add a top-line
comment and README note documenting that constraint.
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="home-manager/services/brew-upgrader/upgrade.sh">
<violation number="1" location="home-manager/services/brew-upgrader/upgrade.sh:5">
P3: Hardcoded Homebrew path is specific to Apple Silicon Macs. On Intel Macs, Homebrew is at `/usr/local/bin/brew`. Consider using a conditional or checking for the path existence, though this may be intentional if only targeting ARM Macs.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| set -euo pipefail | ||
|
|
||
| brew upgrade | ||
| /opt/homebrew/bin/brew upgrade |
There was a problem hiding this comment.
P3: Hardcoded Homebrew path is specific to Apple Silicon Macs. On Intel Macs, Homebrew is at /usr/local/bin/brew. Consider using a conditional or checking for the path existence, though this may be intentional if only targeting ARM Macs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/services/brew-upgrader/upgrade.sh, line 5:
<comment>Hardcoded Homebrew path is specific to Apple Silicon Macs. On Intel Macs, Homebrew is at `/usr/local/bin/brew`. Consider using a conditional or checking for the path existence, though this may be intentional if only targeting ARM Macs.</comment>
<file context>
@@ -2,4 +2,4 @@
set -euo pipefail
-brew upgrade
+/opt/homebrew/bin/brew upgrade
</file context>
| /opt/homebrew/bin/brew upgrade | |
| BREW_PATH="/opt/homebrew/bin/brew" | |
| [ -x "$BREW_PATH" ] || BREW_PATH="/usr/local/bin/brew" | |
| "$BREW_PATH" upgrade |
There was a problem hiding this comment.
Performed full review of de30d90...93f742e
Analysis
-
PATH Handling Inconsistency: The hardcoded path
/opt/homebrew/bin/brewin the brew-upgrader service breaks architectural patterns used elsewhere in the codebase, wherepkgs.lib.makeBinPathis used for declarative PATH construction. -
Portability Issue: The brew path is only valid on Apple Silicon Macs and will break on Intel Macs (which use
/usr/local/bin/brew), creating a cross-platform compatibility problem. -
Missing Documentation: The newly added plenary.nvim testing framework lacks documentation in README.md or CONTRIBUTING.md, making it difficult for contributors to understand how to run tests locally.
-
Architectural Tension: The PR reveals a fundamental tension between Nix's declarative philosophy and pragmatic system realities, especially regarding Homebrew integration which isn't fully managed by the Nix ecosystem.
Tip
Help
Slash Commands:
/review- Request a full code review/review latest- Review only changes since the last review/describe- Generate PR description. This will update the PR body or issue comment depending on your configuration/help- Get help with Mesa commands and configuration options
2 files reviewed | 0 comments | Edit Agent Settings • Read Docs
There was a problem hiding this comment.
Pull request overview
This PR merges the chore-v2 branch into main, adding plenary.nvim-based testing infrastructure with CI/CD integration and the fff.nvim plugin for fast fuzzy file finding. It also updates the brew-upgrader service to use an absolute path for the Homebrew binary.
Key changes:
- Adds fff.nvim plugin with revision hash to nvim-pack-lock.json for fast fuzzy file finding
- Updates brew upgrade script to use absolute path
/opt/homebrew/bin/brew - Testing infrastructure with plenary.nvim already exists in the repository with CI integration
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| home-manager/programs/neovim/nvim-pack-lock.json | Adds fff.nvim plugin entry with commit hash for fast fuzzy file finding functionality |
| home-manager/services/brew-upgrader/upgrade.sh | Updates brew command to use absolute path instead of relying on PATH |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set -euo pipefail | ||
|
|
||
| brew upgrade | ||
| /opt/homebrew/bin/brew upgrade |
There was a problem hiding this comment.
The hardcoded path /opt/homebrew/bin/brew only works on Apple Silicon Macs. Intel Macs install Homebrew to /usr/local/bin/brew.
Consider using a fallback pattern like other scripts in this codebase:
if [ -x /opt/homebrew/bin/brew ]; then
/opt/homebrew/bin/brew upgrade
elif [ -x /usr/local/bin/brew ]; then
/usr/local/bin/brew upgrade
else
echo "brew binary not found" >&2
exit 1
fiThis pattern is used in home-manager/services/ollama/default.nix:11-14 and home-manager/services/cliproxyapi/start.sh:33-36.
| /opt/homebrew/bin/brew upgrade | |
| if [ -x /opt/homebrew/bin/brew ]; then | |
| /opt/homebrew/bin/brew upgrade | |
| elif [ -x /usr/local/bin/brew ]; then | |
| /usr/local/bin/brew upgrade | |
| else | |
| echo "brew binary not found" >&2 | |
| exit 1 | |
| fi |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
Makefile (1)
137-139: Consider guarding launchctl restart targets for non-macOS hostsWiring
switch: nix-switch launchctlis nice for keeping launchd agents in sync with config, but on non-Darwin systems thelaunchctl-*recipes will still run and produce “launchctl: command not found” noise even though|| trueprevents a hard failure.You could make the launchctl targets no-ops off macOS, e.g.:
launchctl-brew-upgrader: ## Restart brew-upgrader launchd agent. @echo "🔄 Restarting brew-upgrader..." @if [ "$(OS)" = "Darwin" ]; then \ launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.brew-upgrader || true; \ else \ echo "Skipping brew-upgrader restart: launchctl is macOS-only (OS=$(OS))"; \ fi @echo "✅ brew-upgrader restart step completed"and mirror that pattern for the other
launchctl-*targets, somake switchstays clean on Linux/CI while still doing the right thing on macOS. Based on learnings, this new “switch also restarts agents” behaviour is probably worth a short note in your Nix/flake docs.Also applies to: 572-609
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
Makefile(2 hunks)home-manager/programs/neovim/lua/keymaps.lua(1 hunks)home-manager/programs/neovim/lua/plugins.lua(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Document all major changes in Nix configurations
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Applies to flake.nix : Maintain flake.nix as the main Nix configuration with proper structure
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Test Nix and home-manager configurations locally before pushing using `make test`
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Test configurations before committing using `nix flake check` and `home-manager build --show-trace`
Applied to files:
Makefile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: nix-linux
- GitHub Check: nix-nixos
- GitHub Check: nix-flake
- GitHub Check: nix-darwin
- GitHub Check: lua-hammerspoon
- GitHub Check: lua-neovim
- GitHub Check: lua-neovim-test
🔇 Additional comments (2)
home-manager/programs/neovim/lua/plugins.lua (2)
26-32: fff.nvim plugin wiring looks consistent with its setupThe pack spec with a
buildfunction and the laterrequire("fff").setup({...})block line up cleanly; install and runtime config should work together without extra changes.
92-94: Git plugins correctly registered for new LazyGit / diff keymapsAdding
kdheepak/lazygit.nvimandesmuellert/vscode-diff.nvimhere is enough to back the<leader>lgand<leader>gDmappings; no additional setup is strictly required as long as thelazygitbinary is on PATH.
| -- @keymap <leader>gg: Open LazyGit | ||
| keymap("n", "<leader>lg", ":LazyGit<cr>", opts) | ||
| -- @keymap <leader>gD: Open VS Code style diff | ||
| keymap("n", "<leader>gD", function() | ||
| require("vscode-diff").diff() | ||
| end, opts) |
There was a problem hiding this comment.
Fix @keymap annotation to match <leader>lg mapping
The doc comment advertises <leader>gg while the actual mapping is <leader>lg, which will confuse any tooling that parses these @keymap annotations.
- -- @keymap <leader>gg: Open LazyGit
-keymap("n", "<leader>lg", ":LazyGit<cr>", opts)
+-- @keymap <leader>lg: Open LazyGit
+keymap("n", "<leader>lg", ":LazyGit<cr>", opts)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| -- @keymap <leader>gg: Open LazyGit | |
| keymap("n", "<leader>lg", ":LazyGit<cr>", opts) | |
| -- @keymap <leader>gD: Open VS Code style diff | |
| keymap("n", "<leader>gD", function() | |
| require("vscode-diff").diff() | |
| end, opts) | |
| -- @keymap <leader>lg: Open LazyGit | |
| keymap("n", "<leader>lg", ":LazyGit<cr>", opts) | |
| -- @keymap <leader>gD: Open VS Code style diff | |
| keymap("n", "<leader>gD", function() | |
| require("vscode-diff").diff() | |
| end, opts) |
🤖 Prompt for AI Agents
In home-manager/programs/neovim/lua/keymaps.lua around lines 120 to 125, the
@keymap docstring incorrectly documents "<leader>gg" while the actual mapping is
"<leader>lg"; update the annotation to "@keymap <leader>lg: Open LazyGit" so the
comment matches the mapping and any tooling parsing these annotations will be
correct.
…mprove error handling
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| set -euo pipefail | ||
|
|
||
| brew upgrade | ||
| /opt/homebrew/bin/brew upgrade |
There was a problem hiding this comment.
The hardcoded path /opt/homebrew/bin/brew assumes Homebrew is installed at the default Apple Silicon location. This will fail on Intel Macs where Homebrew is at /usr/local/bin/brew. Consider checking both locations or using the PATH from the launchd agent configuration which already includes both paths.
| /opt/homebrew/bin/brew upgrade | |
| PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" | |
| brew upgrade |
|
|
||
| .PHONY: switch | ||
| switch: nix-switch ## Apply Nix configuration (alias for nix-switch). | ||
| switch: nix-switch launchctl ## Apply Nix configuration and restart launchd agents. |
There was a problem hiding this comment.
The switch target now depends on launchctl, which will fail on Linux systems since launchctl is a macOS-specific command. Consider adding OS detection (e.g., [ "$(OS)" = "Darwin" ] && $(MAKE) launchctl || true) or making the launchctl target conditional on Darwin, similar to how nix-connect handles OS-specific logic.
| switch: nix-switch launchctl ## Apply Nix configuration and restart launchd agents. | |
| switch: nix-switch ## Apply Nix configuration and restart launchd agents. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| $(MAKE) launchctl; \ | |
| fi |
| @echo "🔄 Restarting brew-upgrader..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.brew-upgrader || true | ||
| @echo "✅ brew-upgrader restarted" | ||
|
|
||
| .PHONY: launchctl-cliproxyapi | ||
| launchctl-cliproxyapi: ## Restart cliproxyapi launchd agent. | ||
| @echo "🔄 Restarting cliproxyapi..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.cliproxyapi || true | ||
| @echo "✅ cliproxyapi restarted" | ||
|
|
||
| .PHONY: launchctl-code-syncer | ||
| launchctl-code-syncer: ## Restart code-syncer launchd agent. | ||
| @echo "🔄 Restarting code-syncer..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.code-syncer || true | ||
| @echo "✅ code-syncer restarted" | ||
|
|
||
| .PHONY: launchctl-dotfiles-updater | ||
| launchctl-dotfiles-updater: ## Restart dotfiles-updater launchd agent. | ||
| @echo "🔄 Restarting dotfiles-updater..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.dotfiles-updater || true | ||
| @echo "✅ dotfiles-updater restarted" | ||
|
|
||
| .PHONY: launchctl-neverssl-keepalive | ||
| launchctl-neverssl-keepalive: ## Restart neverssl-keepalive launchd agent. | ||
| @echo "🔄 Restarting neverssl-keepalive..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.neverssl-keepalive || true | ||
| @echo "✅ neverssl-keepalive restarted" | ||
|
|
||
| .PHONY: launchctl-ollama | ||
| launchctl-ollama: ## Restart ollama launchd agent. | ||
| @echo "🔄 Restarting ollama..." | ||
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.ollama || true | ||
| @echo "✅ ollama restarted" |
There was a problem hiding this comment.
The launchctl targets execute macOS-specific commands without checking the operating system. These should be guarded with OS detection to prevent errors on Linux systems. Consider adding a check like @if [ "$(OS)" = "Darwin" ]; then ... fi or documenting that these targets are Darwin-only.
| @echo "🔄 Restarting brew-upgrader..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.brew-upgrader || true | |
| @echo "✅ brew-upgrader restarted" | |
| .PHONY: launchctl-cliproxyapi | |
| launchctl-cliproxyapi: ## Restart cliproxyapi launchd agent. | |
| @echo "🔄 Restarting cliproxyapi..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.cliproxyapi || true | |
| @echo "✅ cliproxyapi restarted" | |
| .PHONY: launchctl-code-syncer | |
| launchctl-code-syncer: ## Restart code-syncer launchd agent. | |
| @echo "🔄 Restarting code-syncer..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.code-syncer || true | |
| @echo "✅ code-syncer restarted" | |
| .PHONY: launchctl-dotfiles-updater | |
| launchctl-dotfiles-updater: ## Restart dotfiles-updater launchd agent. | |
| @echo "🔄 Restarting dotfiles-updater..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.dotfiles-updater || true | |
| @echo "✅ dotfiles-updater restarted" | |
| .PHONY: launchctl-neverssl-keepalive | |
| launchctl-neverssl-keepalive: ## Restart neverssl-keepalive launchd agent. | |
| @echo "🔄 Restarting neverssl-keepalive..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.neverssl-keepalive || true | |
| @echo "✅ neverssl-keepalive restarted" | |
| .PHONY: launchctl-ollama | |
| launchctl-ollama: ## Restart ollama launchd agent. | |
| @echo "🔄 Restarting ollama..." | |
| @launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.ollama || true | |
| @echo "✅ ollama restarted" | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting brew-upgrader..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.brew-upgrader || true; \ | |
| echo "✅ brew-upgrader restarted"; \ | |
| else \ | |
| echo "❌ brew-upgrader restart is only supported on macOS (Darwin)."; \ | |
| fi | |
| .PHONY: launchctl-cliproxyapi | |
| launchctl-cliproxyapi: ## Restart cliproxyapi launchd agent. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting cliproxyapi..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.cliproxyapi || true; \ | |
| echo "✅ cliproxyapi restarted"; \ | |
| else \ | |
| echo "❌ cliproxyapi restart is only supported on macOS (Darwin)."; \ | |
| fi | |
| .PHONY: launchctl-code-syncer | |
| launchctl-code-syncer: ## Restart code-syncer launchd agent. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting code-syncer..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.code-syncer || true; \ | |
| echo "✅ code-syncer restarted"; \ | |
| else \ | |
| echo "❌ code-syncer restart is only supported on macOS (Darwin)."; \ | |
| fi | |
| .PHONY: launchctl-dotfiles-updater | |
| launchctl-dotfiles-updater: ## Restart dotfiles-updater launchd agent. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting dotfiles-updater..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.dotfiles-updater || true; \ | |
| echo "✅ dotfiles-updater restarted"; \ | |
| else \ | |
| echo "❌ dotfiles-updater restart is only supported on macOS (Darwin)."; \ | |
| fi | |
| .PHONY: launchctl-neverssl-keepalive | |
| launchctl-neverssl-keepalive: ## Restart neverssl-keepalive launchd agent. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting neverssl-keepalive..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.neverssl-keepalive || true; \ | |
| echo "✅ neverssl-keepalive restarted"; \ | |
| else \ | |
| echo "❌ neverssl-keepalive restart is only supported on macOS (Darwin)."; \ | |
| fi | |
| .PHONY: launchctl-ollama | |
| launchctl-ollama: ## Restart ollama launchd agent. | |
| @if [ "$(OS)" = "Darwin" ]; then \ | |
| echo "🔄 Restarting ollama..."; \ | |
| launchctl kickstart -k gui/$$(id -u)/org.nix-community.home.ollama || true; \ | |
| echo "✅ ollama restarted"; \ | |
| else \ | |
| echo "❌ ollama restart is only supported on macOS (Darwin)."; \ | |
| fi |
| keymap("n", "<leader>gs", ":tab Git<cr>", opts) | ||
| -- @keymap <F9>: Open Git mergetool in new tab | ||
| keymap("n", "<F9>", ":tab Git mergetool<cr>", opts) | ||
| -- @keymap <leader>gg: Open LazyGit |
There was a problem hiding this comment.
The comment says <leader>gg but the actual keymap uses <leader>lg. The comment should be updated to match the keymap: -- @keymap <leader>lg: Open LazyGit
| -- @keymap <leader>gg: Open LazyGit | |
| -- @keymap <leader>lg: Open LazyGit |
| "fff.nvim": { | ||
| "rev": "9edf195c8fe71f1ab8f84e863fb27b469d2342bf", | ||
| "src": "https://github.com/dmtrKovalenko/fff.nvim" | ||
| }, |
There was a problem hiding this comment.
The lazygit.nvim and vscode-diff.nvim plugins are referenced in lua/plugins.lua (lines 93-94) and lua/keymaps.lua (lines 121, 123-125), but they are missing from this lock file. This will cause runtime errors when trying to use the keymaps. These plugins need to be added to the lock file with their respective repository URLs and commit hashes.
| "/opt/homebrew/bin/ollama" | ||
| "serve" |
There was a problem hiding this comment.
The hardcoded path /opt/homebrew/bin/ollama assumes Homebrew is installed at the default Apple Silicon location. This will fail on Intel Macs where Homebrew is at /usr/local/bin/ollama. Consider using a more flexible approach similar to the previous implementation that checked both locations, or use pkgs.lib.getExe with a Homebrew-wrapped package.
| "/opt/homebrew/bin/ollama" | |
| "serve" | |
| "/bin/sh" | |
| "-c" | |
| "if [ -x /opt/homebrew/bin/ollama ]; then exec /opt/homebrew/bin/ollama serve; elif [ -x /usr/local/bin/ollama ]; then exec /usr/local/bin/ollama serve; else echo 'ollama not found in Homebrew locations' >&2; exit 1; fi" |
| Service = { | ||
| Type = "simple"; | ||
| ExecStart = "${pkgs.ollama}/bin/ollama serve"; | ||
| Environment = "OLLAMA_HOST=0.0.0.0"; |
There was a problem hiding this comment.
Setting OLLAMA_HOST=0.0.0.0 exposes the Ollama service on all network interfaces, making it accessible from the local network and potentially beyond. Unless this is intentional for network access, consider using 127.0.0.1 to restrict access to localhost only for better security.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
home-manager/services/ollama/default.nix (1)
6-19: Use Nix package path instead of hard-coded Homebrew path.The hard-coded path
/opt/homebrew/bin/ollama(line 10) creates several issues:
- Platform-specific breakage: This path only exists on Apple Silicon Macs. Intel Macs use
/usr/local/bin/ollama, causing the service to fail on those systems.- Platform inconsistency: The Linux service (line 28) correctly uses
${pkgs.ollama}/bin/ollamafrom the Nix package, while Darwin relies on Homebrew.- Violates guidelines: Per learnings, "Use Homebrew only for macOS-specific applications." Ollama is cross-platform and available as
pkgs.ollama.Additionally, service configurations lack documentation explaining parameters (OLLAMA_HOST, log paths, restart behavior), which violates the coding guidelines requiring documentation of all service parameters.
Apply this diff to use the Nix package and add documentation:
+ # Ollama AI model server service + # Configured to listen on all interfaces (0.0.0.0) for network access launchd.agents.ollama = lib.mkIf pkgs.stdenv.isDarwin { enable = true; config = { ProgramArguments = [ - "/opt/homebrew/bin/ollama" + "${pkgs.ollama}/bin/ollama" "serve" ]; KeepAlive = true; RunAtLoad = true; + # Allow network access from other machines EnvironmentVariables.OLLAMA_HOST = "0.0.0.0"; StandardOutPath = "/tmp/ollama.log"; StandardErrorPath = "/tmp/ollama.error.log";Based on learnings, service configurations should document parameters and follow platform conventions.
🧹 Nitpick comments (3)
home-manager/services/neverssl-keepalive/default.nix (2)
1-4: Consider adding a module-level comment documenting this service.As per coding guidelines and learnings, service configurations should include clear documentation for service parameters. A brief comment explaining what this module does (captive portal keepalive via neverssl.com) and any configurable aspects would improve maintainability.
+# neverssl-keepalive: Periodically pings neverssl.com to keep captive portal sessions alive. +# Runs every 3 seconds on both macOS (launchd) and Linux (systemd timer). { pkgs, ... }:
15-25: Consider addingRunAtLoadand sorting attributes alphabetically.The launchd agent may not run immediately on login without
RunAtLoad = true. Also, per coding guidelines, attribute sets should be sorted alphabetically.launchd.agents.neverssl-keepalive = lib.mkIf pkgs.stdenv.isDarwin { - enable = true; config = { + KeepAlive = true; ProgramArguments = [ "${keepaliveScript}/bin/neverssl-keepalive" ]; + RunAtLoad = true; StartInterval = 3; StandardErrorPath = "/tmp/neverssl-keepalive.error.log"; StandardOutPath = "/tmp/neverssl-keepalive.log"; }; + enable = true; };home-manager/services/dotfiles-updater/default.nix (1)
33-60: Linux systemd service + timer wiring looks good; consider a brief doc commentThe Linux side is well structured:
systemd.user.services.dotfiles-updateris guarded withlib.mkIf pkgs.stdenv.isLinux, usesType = "oneshot", setsEnvironment = "PATH=..."vialib.makeBinPath [ pkgs.git pkgs.bash ], and runsExecStart = "${./update.sh}".systemd.user.timers.dotfiles-updateris also guarded withlib.mkIf pkgs.stdenv.isLinux, has a clear description,OnCalendar = "*-*-* 00:00:00"for daily midnight,Persistent = true, andWantedBy = [ "timers.target" ], which matches systemd conventions and dependency handling.To better align with the home-manager service guidelines about documenting service parameters, I’d only suggest adding a compact comment outlining what this service/timer pair does and its schedule, e.g.:
+ # Linux: run dotfiles-updater daily at midnight via systemd user timer. systemd.user.services.dotfiles-updater = lib.mkIf pkgs.stdenv.isLinux { Unit = { Description = "Dotfiles auto-updater service"; }; ... }; + # systemd user timer driving dotfiles-updater. systemd.user.timers.dotfiles-updater = lib.mkIf pkgs.stdenv.isLinux {This keeps the module self-documenting and consistent with the documented expectations for
home-manager/services/**/default.nix. Based on learnings, service modules should clearly describe their behavior and parameters.If you’re using this module on both Darwin and Linux hosts, also confirm that the
launchdoptions are only evaluated where available; otherwise, this cross‑platform pattern is a good fit.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
home-manager/services/dotfiles-updater/default.nix(1 hunks)home-manager/services/neverssl-keepalive/default.nix(2 hunks)home-manager/services/ollama/default.nix(2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.nix
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.nix: Use nixfmt for formatting all Nix files
Document complex configurations with comments in Nix files
**/*.nix: Use 2 spaces for indentation in Nix files
Keep line length under 100 characters in Nix files
Sort attribute sets alphabetically in Nix files
Use consistent spacing around operators in Nix files
Format lists and sets consistently in Nix filesUse treefmt.toml for formatting Nix files
**/*.nix: UsemkOptionfor configurable options in Nix modules
Implement proper typing for all options in Nix modules
Follow the Nix expression language style guide
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
**/default.nix
📄 CodeRabbit inference engine (CLAUDE.md)
Use
default.nixfiles for module exports
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/*/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Service configurations should be located in
home-manager/services/<name>/with proper service definitions and correct dependency handling
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/**/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Service configurations must include proper service definitions, handle dependencies correctly, and document service parameters
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
home-manager/**/*.nix: Use typed options whenever possible in Nix configurations
Document all configuration options in Nix modules and programs
Follow home-manager's module structure and keep configurations modular
Use proper indentation and formatting in Nix configuration files
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/nix.mdc)
Service configurations in
home-manager/services/should follow systemd service conventions, include proper service dependencies, and have clear documentation for service parameters
Files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
🧠 Learnings (11)
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Document all major changes in Nix configurations
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Applies to home-manager/services/**/*.nix : Service configurations in `home-manager/services/` should follow systemd service conventions, include proper service dependencies, and have clear documentation for service parameters
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/services/**/default.nix : Service configurations must include proper service definitions, handle dependencies correctly, and document service parameters
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/services/*/default.nix : Service configurations should be located in `home-manager/services/<name>/` with proper service definitions and correct dependency handling
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Document all configuration options in Nix modules and programs
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/programs/**/*.nix : Follow program-specific best practices in program configuration files
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Keep configurations modular across home-manager, hosts, and nix-darwin directories
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Follow home-manager's module structure and keep configurations modular
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nix
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Applies to home-manager/programs/**/*.nix : Program configurations in `home-manager/programs/` should be organized by program name, include all necessary dependencies, use `home.packages` for package installations, and use `programs.<name>` when available in home-manager
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/programs/*/default.nix : Program configurations should be located in `home-manager/programs/<name>/` and use home-manager's built-in modules when available
Applied to files:
home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:23.224Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.224Z
Learning: Applies to nix-darwin/**/*.nix : Use Homebrew only for macOS-specific applications
Applied to files:
home-manager/services/ollama/default.nixhome-manager/services/dotfiles-updater/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: Agent
- GitHub Check: lua-hammerspoon
- GitHub Check: lua-neovim
- GitHub Check: nix-linux
- GitHub Check: lua-neovim-test
- GitHub Check: nix-nixos
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: nix-darwin
🔇 Additional comments (4)
home-manager/services/neverssl-keepalive/default.nix (3)
5-12: LGTM!Good use of
writeShellApplicationfor proper shell script handling withcurl. The|| trueappropriately ensures the keepalive doesn't fail when the network is unavailable, which is the expected behavior for a background keepalive service.
27-37: LGTM!The systemd service is well-structured with proper dependency handling (
WantsandAfterfornetwork-online.target). UsingType = "oneshot"is appropriate for a timer-triggered service.
39-52: LGTM!The systemd timer is properly configured with
Install.WantedBy = [ "timers.target" ]for automatic startup. The 3-second interval matches the Darwin launchd configuration, ensuring consistent behavior across platforms.home-manager/services/dotfiles-updater/default.nix (1)
1-4: Module header and lib binding look consistent with repo patternsUsing
{ pkgs, ... }withinherit (pkgs) lib;is fine here and keeps the module self-contained without needing a separatelibargument.
| launchd.agents.dotfiles-updater = lib.mkIf pkgs.stdenv.isDarwin { | ||
| enable = true; | ||
| config = { | ||
| ProgramArguments = [ | ||
| "${pkgs.bash}/bin/bash" | ||
| "${./update.sh}" | ||
| ]; | ||
| Environment = { | ||
| PATH = "${ | ||
| lib.makeBinPath [ | ||
| pkgs.git | ||
| pkgs.bash | ||
| pkgs.coreutils | ||
| ] | ||
| }:/opt/homebrew/bin:/usr/local/bin"; | ||
| }; | ||
| StartCalendarInterval = [ | ||
| { | ||
| Hour = 0; | ||
| Minute = 0; | ||
| } | ||
| ]; | ||
| StandardOutPath = "/tmp/dotfiles-updater.log"; | ||
| StandardErrorPath = "/tmp/dotfiles-updater.error.log"; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for launchd configuration examples in the repository
find . -type f -name "*.nix" -exec grep -l "launchd.agents" {} \;Repository: shunkakinoki/dotfiles
Length of output: 361
🏁 Script executed:
# Look for any existing launchd agent configurations to see what key pattern is used
rg "launchd\.agents" -A 20 --max-count=5Repository: shunkakinoki/dotfiles
Length of output: 8607
🌐 Web query:
nix-darwin launchd.agents config EnvironmentVariables documentation
💡 Result:
nix-darwin exposes Launchd options in the launchd module. Relevant keys for environment variables:
- launchd.agents..environment — per-agent environment (attribute set of string or list). Example: { LANG = "nl_NL.UTF-8"; PATH = "/foo/bar/bin"; } . [1]
- launchd.agents..serviceConfig.EnvironmentVariables — maps to the plist ServiceConfig key (attribute set of string). Use this to set additional EnvironmentVariables in the generated plist. [1]
- launchd.envVariables / launchd.user.envVariables — global environment variables applied to all future processes launched by launchd (attribute set of string or list; lists are joined with colons). [1][2]
Minimal example (nix expression):
{
launchd.agents.myagent = {
command = "/path/to/bin";
environment = {
LANG = "en_US.UTF-8";
PATH = [ "/opt/my/tool/bin" ];
};
serviceConfig = {
EnvironmentVariables = {
FOO = "bar";
};
};
};
launchd.envVariables = {
LANG = "en_US.UTF-8";
};
}
Docs / references:
- nix-darwin manual (launchd options: environment, serviceConfig.EnvironmentVariables, envVariables). [1]
- alternate nix-darwin options listing (launchd.envVariables / launchd.user.envVariables). [2]
🏁 Script executed:
# Check how nix-darwin's launchd module actually handles the config attribute
# Search for nix-darwin source or documentation on launchd structure
rg "launchd.*config" --type nix -A 5 -B 5 | head -100Repository: shunkakinoki/dotfiles
Length of output: 47
🌐 Web query:
nix-darwin launchd agents config plist passthrough Environment vs EnvironmentVariables
💡 Result:
Short answer: use EnvironmentVariables. Nix-darwin exposes two higher-level options — launchd.*.environment (and global launchd.envVariables / environment.variables) — which it converts into the plist key EnvironmentVariables, while serviceConfig.EnvironmentVariables lets you set the raw plist key directly. There is no separate launchd plist key named "Environment" (the correct launchd key is EnvironmentVariables). (nix-darwin.github.io)
Practical notes:
- If you want a simple, Nix-native way to pass vars to an agent/daemon, set launchd.user.agents..environment (or launchd.daemons...environment). Nix-darwin will generate the plist with EnvironmentVariables. (nix-darwin.github.io)
- If you need to control arbitrary plist fields (including exact types/structure) or add other launchd keys, use launchd.*.serviceConfig.EnvironmentVariables to place the key directly into the generated plist. (nix-darwin.github.io)
- Do not expect shell expansions there — EnvironmentVariables values must be strings (launchd won’t do variable expansion). (launchd.info)
If you want, tell me which nix-darwin config snippet you’re using and I’ll show the minimal example.
Citations:
- 1: https://nix-darwin.github.io/nix-darwin/manual/index.html?utm_source=openai
- 2: https://nix-darwin.github.io/nix-darwin/manual/index.html?utm_source=openai
- 3: https://nix-darwin.github.io/nix-darwin/manual/index.html?utm_source=openai
- 4: https://www.launchd.info/?utm_source=openai
Change Environment to EnvironmentVariables — PATH override will otherwise be ignored
The launchd plist standard uses EnvironmentVariables for environment variables, not Environment. Using the wrong key causes launchd to ignore it silently, and update.sh will run without the custom PATH you've configured, potentially failing to find git/bash/coreutils.
Change:
config = {
ProgramArguments = [ ... ];
- Environment = {
+ EnvironmentVariables = {
PATH = "${...}";
};Additionally, add documentation above this block explaining what the agent does and why the PATH is customized, as per guidelines for service parameter documentation:
# macOS: daily dotfiles auto-updater via launchd.
# Ensures Git/Bash/coreutils and Homebrew are on PATH under launchd.
launchd.agents.dotfiles-updater = lib.mkIf pkgs.stdenv.isDarwin {🤖 Prompt for AI Agents
In home-manager/services/dotfiles-updater/default.nix around lines 6 to 31, the
launchd agent uses the wrong key "Environment" so the PATH override is ignored;
change the key to "EnvironmentVariables" (preserve the same PATH value and
lib.makeBinPath contents) so launchd applies the PATH, and add the two-line
documentation comment above the block as suggested: a short description that
this is a macOS daily dotfiles auto-updater and that Git/Bash/coreutils and
Homebrew are ensured on the PATH under launchd.
| systemd.user.services.ollama = lib.mkIf pkgs.stdenv.isLinux { | ||
| Unit = { | ||
| Description = "Ollama AI model server"; | ||
| After = [ "network.target" ]; | ||
| }; | ||
| Service = { | ||
| Type = "simple"; | ||
| ExecStart = "${pkgs.ollama}/bin/ollama serve"; | ||
| Environment = "OLLAMA_HOST=0.0.0.0"; | ||
| Restart = "always"; | ||
| RestartSec = 3; | ||
| }; | ||
| Install = { | ||
| WantedBy = [ "default.target" ]; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Add documentation for service parameters.
The systemd service configuration is technically sound and follows systemd conventions correctly. However, it lacks documentation explaining the service parameters, which violates the coding guidelines.
Consider adding comments to document the configuration:
+ # Ollama AI model server service for Linux
+ # Configured to listen on all interfaces (0.0.0.0) for network access
systemd.user.services.ollama = lib.mkIf pkgs.stdenv.isLinux {
Unit = {
Description = "Ollama AI model server";
+ # Start after network is available
After = [ "network.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.ollama}/bin/ollama serve";
+ # Allow network access from other machines
Environment = "OLLAMA_HOST=0.0.0.0";
+ # Restart on failure with 3-second delay
Restart = "always";
RestartSec = 3;
};Based on learnings, service configurations should include clear documentation for service parameters.
🤖 Prompt for AI Agents
In home-manager/services/ollama/default.nix around lines 21 to 36, the
systemd.user.services.ollama block lacks inline documentation for the Unit,
Service and Install parameters; add brief comments above the Unit, Service and
Install blocks describing their purpose and intent, and add short inline
comments for key fields (e.g. Description, After, Type, ExecStart with what is
being started, Environment explaining the exposed variable and value,
Restart/RestartSec semantics, and WantedBy) so readers understand why each
parameter is set and what changing them would do.
…cOS and Linux configurations
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
home-manager/services/neverssl-keepalive/default.nix (1)
1-3: Cross‑platform service/timer wiring is correct; consider whether a 3s interval is desiredThe launchd agent and systemd service/timer are cleanly gated with
lib.mkIf, uselib.makeBinPathfor PATH, and invoke the sharedkeepalive.shvia${pkgs.bash}and an absolute script path, which is robust. Systemd’sWants/Afteronnetwork-online.targetand the oneshot+timer pattern match common conventions.The only thing to think about is the
3/3sinterval on both macOS and Linux. That will hit neverssl.com very frequently; if you don’t actually need sub‑second responsiveness to captive‑portal drops, you might want a longer interval (e.g. tens of seconds or minutes) to reduce noise. If the current behaviour is intentional, the implementation is otherwise in good shape.Also applies to: 6-21, 23-50
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
home-manager/services/cliproxyapi/default.nix(1 hunks)home-manager/services/neverssl-keepalive/default.nix(1 hunks)home-manager/services/neverssl-keepalive/keepalive.sh(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.nix
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.nix: Use nixfmt for formatting all Nix files
Document complex configurations with comments in Nix files
**/*.nix: Use 2 spaces for indentation in Nix files
Keep line length under 100 characters in Nix files
Sort attribute sets alphabetically in Nix files
Use consistent spacing around operators in Nix files
Format lists and sets consistently in Nix filesUse treefmt.toml for formatting Nix files
**/*.nix: UsemkOptionfor configurable options in Nix modules
Implement proper typing for all options in Nix modules
Follow the Nix expression language style guide
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
**/default.nix
📄 CodeRabbit inference engine (CLAUDE.md)
Use
default.nixfiles for module exports
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/*/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Service configurations should be located in
home-manager/services/<name>/with proper service definitions and correct dependency handling
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/**/default.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
Service configurations must include proper service definitions, handle dependencies correctly, and document service parameters
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)
home-manager/**/*.nix: Use typed options whenever possible in Nix configurations
Document all configuration options in Nix modules and programs
Follow home-manager's module structure and keep configurations modular
Use proper indentation and formatting in Nix configuration files
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
home-manager/services/**/*.nix
📄 CodeRabbit inference engine (.cursor/rules/nix.mdc)
Service configurations in
home-manager/services/should follow systemd service conventions, include proper service dependencies, and have clear documentation for service parameters
Files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
**/*.{sh,bash}
📄 CodeRabbit inference engine (CLAUDE.md)
Use shfmt with 2-space indentation for shell scripts
**/*.{sh,bash}: Use 2 spaces for indentation in shell scripts
Add proper shebang lines to shell scripts
Follow shellcheck recommendations in shell scripts
Document complex commands in shell scripts
Use consistent variable naming in shell scripts
Files:
home-manager/services/neverssl-keepalive/keepalive.sh
🧠 Learnings (10)
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Applies to home-manager/services/**/*.nix : Service configurations in `home-manager/services/` should follow systemd service conventions, include proper service dependencies, and have clear documentation for service parameters
Applied to files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/services/**/default.nix : Service configurations must include proper service definitions, handle dependencies correctly, and document service parameters
Applied to files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/services/*/default.nix : Service configurations should be located in `home-manager/services/<name>/` with proper service definitions and correct dependency handling
Applied to files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/programs/**/*.nix : Follow program-specific best practices in program configuration files
Applied to files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Document all major changes in Nix configurations
Applied to files:
home-manager/services/cliproxyapi/default.nixhome-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Applies to home-manager/programs/**/*.nix : Program configurations in `home-manager/programs/` should be organized by program name, include all necessary dependencies, use `home.packages` for package installations, and use `programs.<name>` when available in home-manager
Applied to files:
home-manager/services/cliproxyapi/default.nix
📚 Learning: 2025-11-25T09:34:23.224Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.224Z
Learning: Prefer Nix packages over external package managers
Applied to files:
home-manager/services/cliproxyapi/default.nix
📚 Learning: 2025-11-25T09:34:23.224Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.224Z
Learning: Applies to nix-darwin/**/*.nix : Use Homebrew only for macOS-specific applications
Applied to files:
home-manager/services/cliproxyapi/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Follow home-manager's module structure and keep configurations modular
Applied to files:
home-manager/services/neverssl-keepalive/default.nix
📚 Learning: 2025-11-25T09:34:55.014Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.014Z
Learning: Applies to home-manager/**/*.nix : Document all configuration options in Nix modules and programs
Applied to files:
home-manager/services/neverssl-keepalive/default.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: nix-nixos
- GitHub Check: nix-darwin
- GitHub Check: nix-flake
- GitHub Check: nix-linux
- GitHub Check: lua-hammerspoon
- GitHub Check: lua-neovim-test
- GitHub Check: lua-neovim
🔇 Additional comments (2)
home-manager/services/neverssl-keepalive/keepalive.sh (1)
1-8: Straightforward, safe keepalive implementationShebang,
set -euo pipefail, and the guardedcurlinvocation look good and align with the shell guidelines for this repo; no changes needed.home-manager/services/cliproxyapi/default.nix (1)
2-4: Launchd + systemd wiring looks solid; just confirm PATH covers allstart.shtoolsThe switch to
lib.mkIf/lib.makeBinPathand the split Darwin/Linux definitions follow home‑manager and systemd conventions nicely, and the absolute${pkgs.bash}/${./start.sh}ExecStart/ProgramArguments are robust.Only thing to double‑check: on both platforms the PATH you construct currently exposes
gnused(andbashon Linux). Ifstart.shrelies on additional tools (curl, jq, etc.), make sure they’re added to thelib.makeBinPathlists so the service doesn’t become environment‑dependent.Also applies to: 6-7, 14-15, 23-38
Add plenary.nvim-based testing with CI/CD integration and fff.nvim plugin for fast fuzzy file finding.
Summary by cubic
Adds Neovim Git tooling and faster fuzzy finding, and adds Makefile targets to restart launchd agents. Also updates macOS/Linux Home Manager services (dotfiles-updater, neverssl-keepalive, ollama, cliproxyapi) and fixes the brew upgrader path for reliable upgrades.
New Features
Bug Fixes
Written for commit 85f29de. Summary will update automatically on new commits.