Skip to content

chore: sync chore-v2 branch with main - #397

Merged
shunkakinoki merged 9 commits into
mainfrom
chore-v2
Dec 6, 2025
Merged

chore: sync chore-v2 branch with main#397
shunkakinoki merged 9 commits into
mainfrom
chore-v2

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Dec 6, 2025

Copy link
Copy Markdown
Owner

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

    • Neovim: Added LazyGit and VS Code diff plugins with keymaps (lg, gD), plus fff.nvim for faster file search.
    • Makefile: Added launchctl targets and made switch restart launchd agents.
  • Bug Fixes

    • Updated brew-upgrader to call /opt/homebrew/bin/brew upgrade to avoid PATH issues on macOS.

Written for commit 85f29de. Summary will update automatically on new commits.

Copilot AI review requested due to automatic review settings December 6, 2025 16:33
@coderabbitai

coderabbitai Bot commented Dec 6, 2025

Copy link
Copy Markdown

Note

Other AI code review bot(s) detected

CodeRabbit 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.

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added Git integration features to Neovim: LazyGit bindings (<leader>lg) and VS Code-style diff viewer (<leader>gD).
    • Added new Neovim plugins: lazygit.nvim, vscode-diff.nvim, and fff.nvim for enhanced functionality.
    • Added new Makefile targets for managing system services via launchctl commands.
  • Chores

    • Updated service configurations for improved cross-platform support.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Adds a Neovim plugin lock entry and two Git-related plugins with keymaps, adds Makefile launchctl targets and makes switch depend on them, changes brew upgrader to call /opt/homebrew/bin/brew, and converts several home-manager services to platform-guarded Darwin launchd / Linux systemd units with updated module signatures.

Changes

Cohort / File(s) Summary
Neovim pack lock
home-manager/programs/neovim/nvim-pack-lock.json
Added plugin entry fff.nvim with rev and src fields.
Neovim plugins & keymaps
home-manager/programs/neovim/lua/plugins.lua, home-manager/programs/neovim/lua/keymaps.lua
Added kdheepak/lazygit.nvim and esmuellert/vscode-diff.nvim; added normal-mode keymaps <leader>lg (LazyGit) and <leader>gD (vscode-diff invocation).
Makefile: launchctl targets
Makefile
Added per-agent launchctl-... targets and composite launchctl; made switch depend on launchctl.
Brew upgrader script
home-manager/services/brew-upgrader/upgrade.sh
Replaced brew upgrade with explicit /opt/homebrew/bin/brew upgrade.
Dotfiles updater service
home-manager/services/dotfiles-updater/default.nix
Changed module signature to { pkgs, ... }; introduced lib binding; added Darwin launchd.agents.dotfiles-updater; conditionalized Linux systemd service/timer via lib.mkIf; adjusted PATH handling.
neverssl keepalive
home-manager/services/neverssl-keepalive/default.nix, home-manager/services/neverssl-keepalive/keepalive.sh
Changed signature to { pkgs, ... }; added lib; introduced keepalive.sh (strict bash with curl -fsS --max-time 10
Ollama service
home-manager/services/ollama/default.nix
Changed signature to { pkgs, ... }; removed Homebrew wrapper; added Darwin launchd.agents.ollama (hard-coded /opt/homebrew/bin/ollama) and Linux systemd.user.services.ollama with explicit ExecStart and env/restart settings.
CLI proxy service
home-manager/services/cliproxyapi/default.nix
Replaced pkgs.lib.mkIf with lib.mkIf via lib binding; switched to lib.makeBinPath; added Linux systemd.user.services.cliproxyapi.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review nix module signature changes and correct lib imports/usages in each default.nix.
  • Verify Darwin launchd ProgramArguments, hard-coded /opt/homebrew/... paths, and log path correctness.
  • Validate Linux systemd unit/timer conditionals (lib.mkIf) and PATH construction via lib.makeBinPath.
  • Confirm Makefile launchctl targets are idempotent and safe on non-Darwin platforms.

Possibly related PRs

Suggested labels

codex

Poem

🐰 I hopped through config, line by line,
Added plugins, shortcuts, and a tiny shine,
Services wake on mac and Linux too,
Brew finds its path — hoppity-doo! 🌿

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore: sync chore-v2 branch with main' is generic and vague, using non-descriptive terms that don't convey meaningful information about the actual changes. Consider a more specific title that highlights the main changes, such as 'Add Neovim Git tooling, fff.nvim, and launchctl targets' or 'Add fff.nvim, LazyGit, VS Code diff plugins, and Makefile launchctl targets'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The description is related to the changeset and provides meaningful context about the main features added and bug fixes included.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore-v2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 chore-v2 branch with main, primarily by enhancing the Neovim setup with a new fuzzy file finder plugin and refining the Homebrew upgrade script to use an explicit command path. These changes aim to improve development tooling and system maintenance processes.

Highlights

  • Neovim Plugin Addition: The fff.nvim plugin has been added to the Neovim configuration, providing fast fuzzy file finding capabilities.
  • Homebrew Upgrade Path Correction: The brew upgrade command in the brew-upgrader service script has been updated to use its full explicit path, /opt/homebrew/bin/brew upgrade, ensuring robust execution.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mesa-dot-dev

mesa-dot-dev Bot commented Dec 6, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Syncs chore-v2 with main, adding Neovim Git tooling and faster fuzzy finding, Makefile targets to restart launchd agents, and updates Home Manager services, including a fix for the brew-upgrader path.

What changed?

  • home-manager/programs/neovim/nvim-pack-lock.json: Updated Neovim package lock file, reflecting additions of LazyGit, VS Code diff plugins, and fff.nvim.
  • home-manager/services/brew-upgrader/upgrade.sh: Modified to use the absolute path /opt/homebrew/bin/brew for brew upgrade to resolve PATH issues on macOS.

Description generated by Mesa. Update settings

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
/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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between de30d90 and 93f742e.

📒 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.nvim entry 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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
+fi

Alternatively, 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cubic-dev-ai cubic-dev-ai Bot Dec 6, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
/opt/homebrew/bin/brew upgrade
BREW_PATH="/opt/homebrew/bin/brew"
[ -x "$BREW_PATH" ] || BREW_PATH="/usr/local/bin/brew"
"$BREW_PATH" upgrade
Fix with Cubic

@mesa-dot-dev mesa-dot-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performed full review of de30d90...93f742e

Analysis

  1. PATH Handling Inconsistency: The hardcoded path /opt/homebrew/bin/brew in the brew-upgrader service breaks architectural patterns used elsewhere in the codebase, where pkgs.lib.makeBinPath is used for declarative PATH construction.

  2. 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.

  3. 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.

  4. 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 SettingsRead Docs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
fi

This pattern is used in home-manager/services/ollama/default.nix:11-14 and home-manager/services/cliproxyapi/start.sh:33-36.

Suggested change
/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

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Makefile (1)

137-139: Consider guarding launchctl restart targets for non-macOS hosts

Wiring switch: nix-switch launchctl is nice for keeping launchd agents in sync with config, but on non-Darwin systems the launchctl-* recipes will still run and produce “launchctl: command not found” noise even though || true prevents 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, so make switch stays 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 93f742e and 80859c6.

📒 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 setup

The pack spec with a build function and the later require("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 keymaps

Adding kdheepak/lazygit.nvim and esmuellert/vscode-diff.nvim here is enough to back the <leader>lg and <leader>gD mappings; no additional setup is strictly required as long as the lazygit binary is on PATH.

Comment on lines +120 to +125
-- @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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Suggested change
-- @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.

Copilot AI review requested due to automatic review settings December 6, 2025 16:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/opt/homebrew/bin/brew upgrade
PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
brew upgrade

Copilot uses AI. Check for mistakes.
Comment thread Makefile

.PHONY: switch
switch: nix-switch ## Apply Nix configuration (alias for nix-switch).
switch: nix-switch launchctl ## Apply Nix configuration and restart launchd agents.

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment thread Makefile
Comment on lines +577 to +609
@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"

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
@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

Copilot uses AI. Check for mistakes.
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

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
-- @keymap <leader>gg: Open LazyGit
-- @keymap <leader>lg: Open LazyGit

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +71
"fff.nvim": {
"rev": "9edf195c8fe71f1ab8f84e863fb27b469d2342bf",
"src": "https://github.com/dmtrKovalenko/fff.nvim"
},

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to 11
"/opt/homebrew/bin/ollama"
"serve"

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"/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"

Copilot uses AI. Check for mistakes.
Service = {
Type = "simple";
ExecStart = "${pkgs.ollama}/bin/ollama serve";
Environment = "OLLAMA_HOST=0.0.0.0";

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.
  2. Platform inconsistency: The Linux service (line 28) correctly uses ${pkgs.ollama}/bin/ollama from the Nix package, while Darwin relies on Homebrew.
  3. 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 adding RunAtLoad and 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 comment

The Linux side is well structured:

  • systemd.user.services.dotfiles-updater is guarded with lib.mkIf pkgs.stdenv.isLinux, uses Type = "oneshot", sets Environment = "PATH=..." via lib.makeBinPath [ pkgs.git pkgs.bash ], and runs ExecStart = "${./update.sh}".
  • systemd.user.timers.dotfiles-updater is also guarded with lib.mkIf pkgs.stdenv.isLinux, has a clear description, OnCalendar = "*-*-* 00:00:00" for daily midnight, Persistent = true, and WantedBy = [ "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 launchd options 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 80859c6 and 0e7d9aa.

📒 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 files

Use treefmt.toml for formatting Nix files

**/*.nix: Use mkOption for 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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-manager/services/neverssl-keepalive/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/services/ollama/default.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • 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/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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • 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/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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • 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/ollama/default.nix
  • home-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.nix
  • home-manager/services/dotfiles-updater/default.nix
  • home-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.nix
  • home-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.nix
  • home-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.nix
  • home-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.nix
  • home-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 writeShellApplication for proper shell script handling with curl. The || true appropriately 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 (Wants and After for network-online.target). Using Type = "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 patterns

Using { pkgs, ... } with inherit (pkgs) lib; is fine here and keeps the module self-contained without needing a separate lib argument.

Comment on lines +6 to +31
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";
};
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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=5

Repository: 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 -100

Repository: 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:


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.

Comment on lines +21 to +36
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" ];
};
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ 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.

@shunkakinoki
shunkakinoki merged commit 9406219 into main Dec 6, 2025
19 of 21 checks passed
@shunkakinoki
shunkakinoki deleted the chore-v2 branch December 6, 2025 17:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 desired

The launchd agent and systemd service/timer are cleanly gated with lib.mkIf, use lib.makeBinPath for PATH, and invoke the shared keepalive.sh via ${pkgs.bash} and an absolute script path, which is robust. Systemd’s Wants/After on network-online.target and the oneshot+timer pattern match common conventions.

The only thing to think about is the 3/3s interval 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 0e7d9aa and 85f29de.

📒 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 files

Use treefmt.toml for formatting Nix files

**/*.nix: Use mkOption for 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.nix
  • home-manager/services/neverssl-keepalive/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/services/cliproxyapi/default.nix
  • home-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.nix
  • home-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.nix
  • home-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.nix
  • home-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.nix
  • home-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.nix
  • 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/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.nix
  • 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/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.nix
  • 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/programs/**/*.nix : Follow program-specific best practices in program configuration files

Applied to files:

  • home-manager/services/cliproxyapi/default.nix
  • home-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.nix
  • home-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 implementation

Shebang, set -euo pipefail, and the guarded curl invocation 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 all start.sh tools

The switch to lib.mkIf/lib.makeBinPath and 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 (and bash on Linux). If start.sh relies on additional tools (curl, jq, etc.), make sure they’re added to the lib.makeBinPath lists so the service doesn’t become environment‑dependent.

Also applies to: 6-7, 14-15, 23-38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants