Skip to content

Restore Ollama service and update Homebrew configuration - #368

Merged
shunkakinoki merged 4 commits into
mainfrom
ollama-config
Nov 26, 2025
Merged

Restore Ollama service and update Homebrew configuration#368
shunkakinoki merged 4 commits into
mainfrom
ollama-config

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Nov 26, 2025

Copy link
Copy Markdown
Owner

Restore the Ollama service and ensure it is correctly integrated with Homebrew. Update CI workflow validation steps for Neovim and Hammerspoon configurations, enhancing the development shell to include Neovim and improve readiness messaging.


Summary by cubic

Restore the Ollama service on macOS and integrate it with Homebrew for reliable binary management. CI Lua checks now run via the dev shell, which includes Neovim.

  • New Features

    • Re-enable the Ollama launchd agent via home-manager.
    • Add a wrapper to run the Homebrew-installed ollama binary, with /opt/homebrew and /usr/local fallbacks.
    • Install Homebrew “ollama” and enable “ollama-app” in masApps.
    • Run Neovim and Hammerspoon Lua checks through nix develop; dev shell now includes Neovim.
  • Migration

    • Run nix-darwin switch to apply changes; Homebrew will install the required packages.

Written for commit 0f566a9. Summary will update automatically on new commits.

Copilot AI review requested due to automatic review settings November 26, 2025 05:02
@shunkakinoki
shunkakinoki enabled auto-merge (squash) November 26, 2025 05:02
@shunkakinoki shunkakinoki self-assigned this Nov 26, 2025
@coderabbitai

coderabbitai Bot commented Nov 26, 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 support for Ollama service with Homebrew installation option.
  • Chores

    • Improved development environment configuration for streamlined setup processes.
    • Updated CI workflows to use standardized development shell execution.

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

Walkthrough

The PR introduces a dev shell-based approach for Lua validation, refactors the flake.nix perSystem function to use a custom package set overlay, enables ollama in home-manager services with Homebrew integration, and adds ollama to the macOS homebrew configuration.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/lua.yml
Replaced explicit tool validation steps with dev shell executions; Lua checks now run via nix develop .# --command make lua-check-*
Flake Configuration
flake.nix
Refactored perSystem signature; introduced local overlays and custom devPkgs; exposed devPkgs via _module.args.pkgs; dev shell now sources nodejs, bun, and neovim from devPkgs
Home Manager Services
home-manager/services/default.nix
Uncommented and enabled ollama service binding; added ollama to the exported services list
Ollama Service Module
home-manager/services/ollama/default.nix
Added writeShellApplication import; introduced ollamaHomebrew wrapper for locating Homebrew-installed ollama binary; updated ProgramArguments to use wrapper executable
macOS Homebrew Config
nix-darwin/config/homebrew.nix
Added ollama to brews list; enabled ollama-app cask

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • flake.nix perSystem refactoring: Requires verification that custom overlay application and devPkgs exposure don't break existing module behavior or introduce unintended side effects
  • Ollama integration chain: Review the wrapper script logic in home-manager/services/ollama/default.nix to ensure correct Homebrew binary path resolution and fallback behavior
  • Consistency across configurations: Verify that enabling ollama in home-manager and homebrew works cohesively with the flake-based dev environment

Possibly related PRs

Suggested labels

codex

Poem

🐰 A dev shell blooms with Lua's light,
Ollama hops in, a fuzzy delight,
Flakes are refactored, packages arranged,
Darwin's brew bubbles—no more estranged!
Nix overlays dance, the config takes flight! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: restoring the Ollama service and updating Homebrew configuration, which are the primary objectives of this pull request.
Description check ✅ Passed The description is well-related to the changeset, providing context about Ollama restoration, Homebrew integration, CI workflow updates, and dev shell improvements across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ollama-config

📜 Recent 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 f932859 and 0f566a9.

📒 Files selected for processing (5)
  • .github/workflows/lua.yml (2 hunks)
  • flake.nix (2 hunks)
  • home-manager/services/default.nix (1 hunks)
  • home-manager/services/ollama/default.nix (1 hunks)
  • nix-darwin/config/homebrew.nix (2 hunks)
🧰 Additional context used
📓 Path-based instructions (11)
.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

GitHub Actions workflows must be properly configured in .github/workflows/ directory

Files:

  • .github/workflows/lua.yml
.github/workflows/*.yml

📄 CodeRabbit inference engine (.cursor/rules/github-workflows.mdc)

.github/workflows/*.yml: CI Pipeline must run on all pull requests and main branch pushes, validating Nix flake checks, home-manager builds, nix-darwin builds, and system configurations
Run Biome for code formatting and validate Nix expressions, commit message format, and documentation updates in code quality checks
Use specific action versions (not @main or @master) in GitHub Actions workflows
Cache Nix store and build artifacts in GitHub Actions workflows to improve performance
Set appropriate timeout limits in GitHub Actions workflow jobs
Use concise job and step names in GitHub Actions workflows and add helpful annotations and comments
Use GITHUB_TOKEN when possible, secure sensitive data in repository secrets, and limit permissions to minimum required in GitHub Actions workflows
Review third-party actions before use in GitHub Actions workflows
Set appropriate failure conditions, add helpful error messages, configure notifications for failures, and archive build artifacts for debugging in GitHub Actions workflows

Files:

  • .github/workflows/lua.yml
{.github/workflows/*.yml,renovate.json}

📄 CodeRabbit inference engine (.cursor/rules/github-workflows.mdc)

Use Renovate for automated dependency updates, configure update schedule in renovate.json, group related updates together, and auto-merge minor and patch updates

Files:

  • .github/workflows/lua.yml
**/*.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/default.nix
  • home-manager/services/ollama/default.nix
  • nix-darwin/config/homebrew.nix
  • flake.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/services/default.nix
  • home-manager/services/ollama/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/default.nix
  • home-manager/services/ollama/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/default.nix
  • home-manager/services/ollama/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/default.nix
  • home-manager/services/ollama/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
nix-darwin/**/*.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use Homebrew only for macOS-specific applications

Files:

  • nix-darwin/config/homebrew.nix
flake.nix

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Maintain flake.nix as the main Nix configuration with proper structure

Always pin package versions in flake.lock

Files:

  • flake.nix
🧠 Learnings (22)
📓 Common learnings
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.052Z
Learning: Applies to flake.nix : Maintain flake.nix as the main Nix configuration with proper structure
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
Learning: Test configurations before committing using `nix flake check` and `home-manager build --show-trace`
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-11-25T09:34:47.810Z
Learning: Applies to .github/workflows/*.yml : CI Pipeline must run on all pull requests and main branch pushes, validating Nix flake checks, home-manager builds, nix-darwin builds, and system configurations
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.006Z
Learning: Applies to home-manager/programs/**/*.nix : Follow program-specific best practices in program configuration files
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.209Z
Learning: Applies to nix-darwin/**/*.nix : Use Homebrew only for macOS-specific applications
📚 Learning: 2025-11-25T09:34:47.810Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-11-25T09:34:47.810Z
Learning: Applies to .github/workflows/*.yml : Run Biome for code formatting and validate Nix expressions, commit message format, and documentation updates in code quality checks

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:34:23.209Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.209Z
Learning: Applies to **/default.nix : Use `default.nix` files for module exports

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:35:01.056Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
Learning: Applies to home-manager/modules/**/default.nix : Each module in `home-manager/modules/` should have a clear `default.nix` with proper option declarations following the home-manager module structure

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:34:47.810Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-11-25T09:34:47.810Z
Learning: Applies to .github/workflows/*.yml : CI Pipeline must run on all pull requests and main branch pushes, validating Nix flake checks, home-manager builds, nix-darwin builds, and system configurations

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:34:23.209Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.209Z
Learning: Applies to nix-darwin/**/*.nix : Use Homebrew only for macOS-specific applications

Applied to files:

  • .github/workflows/lua.yml
  • home-manager/services/ollama/default.nix
  • nix-darwin/config/homebrew.nix
📚 Learning: 2025-11-25T09:34:47.810Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-11-25T09:34:47.810Z
Learning: Applies to .github/workflows/*.yml : Cache Nix store and build artifacts in GitHub Actions workflows to improve performance

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:35:01.056Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
Learning: Test configurations before committing using `nix flake check` and `home-manager build --show-trace`

Applied to files:

  • .github/workflows/lua.yml
  • flake.nix
📚 Learning: 2025-11-25T09:34:40.052Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.052Z
Learning: Test Nix and home-manager configurations locally before pushing using `make test`

Applied to files:

  • .github/workflows/lua.yml
📚 Learning: 2025-11-25T09:34:55.006Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.006Z
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/default.nix
  • home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:55.005Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.005Z
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/default.nix
📚 Learning: 2025-11-25T09:35:01.056Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
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/default.nix
📚 Learning: 2025-11-25T09:35:01.056Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
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/default.nix
  • home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:55.006Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.006Z
Learning: Applies to home-manager/programs/**/*.nix : Follow program-specific best practices in program configuration files

Applied to files:

  • home-manager/services/default.nix
  • home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:23.210Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T09:34:23.210Z
Learning: Prefer Nix packages over external package managers

Applied to files:

  • home-manager/services/default.nix
📚 Learning: 2025-11-25T09:34:40.052Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.052Z
Learning: Document all major changes in Nix configurations

Applied to files:

  • home-manager/services/ollama/default.nix
  • nix-darwin/config/homebrew.nix
  • flake.nix
📚 Learning: 2025-11-25T09:34:55.006Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.006Z
Learning: Applies to home-manager/**/*.nix : Document all configuration options in Nix modules and programs

Applied to files:

  • home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:55.006Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.006Z
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
📚 Learning: 2025-11-25T09:34:55.005Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.005Z
Learning: Applies to home-manager/programs/**/default.nix : Program configurations must include all necessary dependencies in their configuration

Applied to files:

  • home-manager/services/ollama/default.nix
📚 Learning: 2025-11-25T09:34:55.005Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/home-manager.mdc:0-0
Timestamp: 2025-11-25T09:34:55.005Z
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:40.052Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.052Z
Learning: Applies to flake.nix : Maintain flake.nix as the main Nix configuration with proper structure

Applied to files:

  • flake.nix
📚 Learning: 2025-11-25T09:35:01.056Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.056Z
Learning: Applies to flake.nix : Always pin package versions in `flake.lock`

Applied to files:

  • flake.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). (10)
  • GitHub Check: lua-neovim
  • GitHub Check: lua-hammerspoon
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
  • GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • GitHub Check: nix-nixos
  • GitHub Check: nix-linux
  • GitHub Check: nix-darwin
🔇 Additional comments (3)
home-manager/services/ollama/default.nix (1)

3-20: Homebrew-backed wrapper + launchd integration looks solid

Using writeShellApplication with explicit /opt/homebrew and /usr/local probes and gating the agent behind pkgs.stdenv.isDarwin cleanly ties the service to the Homebrew‑managed Ollama binary on macOS. The short comment above ollamaHomebrew documents the major change and matches the “Homebrew only for macOS-specific applications” guidance. No functional issues from my side.

Also applies to: 27-27

home-manager/services/default.nix (1)

6-6: Correctly wires the new ollama service into the services set

Importing ./ollama with inherit pkgs and exporting it in the services list matches the existing pattern and keeps the service modular and discoverable via this default.nix, as per the home-manager service structure guidelines.

Also applies to: 14-14

flake.nix (1)

120-157: perSystem devPkgs refactor is coherent; watch for behavior changes from the new pkgs set

Deriving devPkgs via your overlays + nixpkgs-config.nix and exposing it through _module.args.pkgs is a clean way to keep devShells and flake‑parts modules (like treefmt) on a single, explicitly‑constructed package set. Switching the dev shell to devPkgs.mkShell with devPkgs.nodejs, devPkgs.bun, and devPkgs.neovim looks consistent; just be aware this may subtly change versions vs the previous pkgs.* selections (e.g., nodejs_20 → default nodejs). Based on learnings, it’s worth running nix flake check and nix develop .# on your target systems to confirm everything resolves as expected.


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 focuses on restoring and improving the integration of the Ollama service within the development environment, specifically by aligning it with Homebrew installations. Additionally, it enhances the default development shell by incorporating Neovim and refactors the Nix flake to better manage development packages.

Highlights

  • Ollama Service Restoration: The Ollama service has been re-enabled after being temporarily disabled due to previous build issues.
  • Homebrew Integration for Ollama: The Ollama service now utilizes a Homebrew-installed binary via a new launchd wrapper, and the Homebrew configuration has been updated to include both the ollama CLI and the ollama-app cask.
  • Neovim in Development Shell: Neovim has been added to the default development shell's packages, and the shell's readiness message has been updated to reflect its inclusion.
  • Nix Flake Refactoring: The flake.nix configuration has been refactored to explicitly define and manage devPkgs using custom overlays and configurations, enhancing package consistency and flexibility within the perSystem scope.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/lua.yml
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.

@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 effectively restores the Ollama service by integrating it with Homebrew for more reliable binary management, which is a smart workaround for the previous build issues with the Nix package. The changes are well-contained and logical. You've correctly updated the Homebrew configuration to install ollama and ollama-app, and the launchd service is now correctly pointing to the Homebrew-managed binary via a wrapper script. Additionally, the development shell is enhanced to include Neovim, which aligns with the goal of improving the CI workflow. I have one suggestion to improve the shell script in the ollama service for better maintainability.

Comment on lines +11 to +18
if [ -x /opt/homebrew/bin/ollama ]; then
exec /opt/homebrew/bin/ollama "$@"
elif [ -x /usr/local/bin/ollama ]; then
exec /usr/local/bin/ollama "$@"
else
echo "ollama binary not found; install it with \"brew install ollama\"" >&2
exit 1
fi

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

For better readability and future extensibility, you could simplify this shell script. Using a for loop to iterate over a list of possible paths for the ollama binary would make the script cleaner and easier to update if more search paths are needed in the future. The logic becomes more straightforward: iterate through paths, and if none are found, then exit with an error.

      for OLLAMA_PATH in /opt/homebrew/bin/ollama /usr/local/bin/ollama; do
        if [ -x "$OLLAMA_PATH" ]; then
          exec "$OLLAMA_PATH" "$@"
        fi
      done

      echo "ollama binary not found; install it with \"brew install ollama\"" >&2
      exit 1

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 restores the Ollama service by switching from a nixpkgs-based installation to a Homebrew-based approach, resolving previous build conflicts. It also modernizes the CI workflow to use the development shell for Lua validation tasks and adds Neovim to the development environment.

Key Changes:

  • Restored Ollama service with Homebrew wrapper to avoid nixpkgs build issues
  • Updated CI workflow to use nix develop for consistent Neovim and Hammerspoon validation
  • Enhanced development shell with Neovim and custom pkgs configuration

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
nix-darwin/config/homebrew.nix Added ollama formula and ollama-app cask, removing the FIXME comment about conflicts
home-manager/services/ollama/default.nix Introduced Homebrew wrapper script to use system-installed Ollama binary instead of nixpkgs
home-manager/services/default.nix Re-enabled the Ollama service by uncommenting its import
flake.nix Restructured perSystem to use custom pkgs with overlays, added Neovim to devShell
.github/workflows/lua.yml Updated CI to use nix develop for Neovim and Hammerspoon validation steps
Comments suppressed due to low confidence (1)

home-manager/services/ollama/default.nix:32

  • Binding Ollama to 0.0.0.0 exposes the service to all network interfaces, potentially allowing external access. This is a security risk on shared or public networks. Consider using 127.0.0.1 for localhost-only access, or document why external access is required and add firewall/network restrictions.
      EnvironmentVariables.OLLAMA_HOST = "0.0.0.0";

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"kurtosis-cli"
"mas"
"opencode"
"ollama"

Copilot AI Nov 26, 2025

Copy link

Choose a reason for hiding this comment

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

Installing both the ollama formula (CLI) and ollama-app cask (GUI) creates potential conflicts. The Ollama app includes its own CLI binary at the same path, which could cause version mismatches or confusion. Consider documenting why both are needed or removing one if redundant.

Suggested change
"ollama"

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/lua.yml
- name: Validate Neovim Configuration
run: make lua-check-neovim
- name: Validate Neovim Configuration (Dev Shell)
run: nix develop .# --command make lua-check-neovim

Copilot AI Nov 26, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The .# syntax should be .#default for clarity. While .# implicitly refers to the default development shell, being explicit improves readability and avoids potential confusion.

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/lua.yml
- name: Validate Hammerspoon Configuration
run: make lua-check-hammerspoon
- name: Validate Hammerspoon Configuration (Dev Shell)
run: nix develop .# --command make lua-check-hammerspoon

Copilot AI Nov 26, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The .# syntax should be .#default for clarity. While .# implicitly refers to the default development shell, being explicit improves readability and avoids potential confusion.

Suggested change
run: nix develop .# --command make lua-check-hammerspoon
run: nix develop .#default --command make lua-check-hammerspoon

Copilot uses AI. Check for mistakes.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/lua.yml
Comment on lines +39 to +40
- name: Validate Hammerspoon Configuration (Dev Shell)
run: nix develop .# --command make lua-check-hammerspoon

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep macOS CI on supported nix systems

The macOS job now enters the flake dev shell via nix develop .# --command make lua-check-hammerspoon, but the flake only declares systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" ]. On the default GitHub macos-latest runner (which is still x86_64-darwin), nix develop aborts with “system not supported” before the Lua check runs, breaking the job. Consider switching the runner to an arm64 image or adding x86_64-darwin to the flake systems so the dev shell can be instantiated on macOS CI.

Useful? React with 👍 / 👎.

@mesa-dot-dev

mesa-dot-dev Bot commented Nov 26, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Restore the Ollama service on macOS, integrating it with Homebrew, and update CI Lua checks to run within a Nix development shell that now includes Neovim.

What changed?

  • .github/workflows/lua.yml: CI workflow for Lua validation now uses nix develop .# --command for Neovim and Hammerspoon configurations, simplifying the CI setup.
  • flake.nix: Refactored to define and use devPkgs with custom overlays; the default development shell now includes neovim and has an updated shellHook message.
  • home-manager/services/default.nix: The ollama service has been re-enabled in home-manager services.
  • home-manager/services/ollama/default.nix: The ollama service is reconfigured to use a Homebrew-installed ollama binary via a custom ollamaHomebrew wrapper script.
  • nix-darwin/config/homebrew.nix: Added "ollama" to Homebrew formulae and re-enabled "ollama-app" in Homebrew casks.

Description generated by Mesa. Update settings

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

No issues found across 5 files

@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 f932859...a61400d

Analysis

  1. Broken Reproducibility - Homebrew-installed Ollama isn't captured in flake.lock, creating unversioned dependencies outside of Nix's declarative model that could lead to version incompatibilities across different systems.

  2. Two-Phase Installation Process - System now requires both darwin-rebuild switch AND manual brew install ollama to function properly, breaking the single-command deployment model of Nix.

  3. Service Reliability Issues - The launchd service with KeepAlive=true will continuously restart if the Homebrew binary is missing or incompatible, potentially consuming system resources without clear error reporting.

  4. Hidden State Dependencies - The Nix configuration now has implicit runtime dependencies on Homebrew state that aren't declared in flake.nix, making the system less predictable and self-documenting.

  5. Lack of Version Validation - No mechanism exists to ensure the Homebrew-installed Ollama version is compatible with expected service interfaces, risking runtime incompatibilities after Homebrew updates.

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

5 files reviewed | 4 comments | Edit Agent SettingsRead Docs

"kurtosis-cli"
"mas"
"opencode"
"ollama"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

This formula is now a required runtime dependency for the home-manager Ollama service, not just an optional installation. Consider documenting this dependency relationship with a comment, and note that since Homebrew formulae aren't version-pinned here, brew upgrade could introduce breaking changes without corresponding updates to the Nix service configuration. You may want to add a comment about version compatibility expectations.
Agent: 🏛 Architecture

inherit (pkgs) lib;
inherit (pkgs) lib writeShellApplication;

# launchd wrapper so we can reuse the Homebrew-installed ollama binary

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

This wrapper pattern creates a runtime dependency on Homebrew state that isn't captured in flake.lock, breaking Nix's reproducibility guarantees. Consider adding: (1) a comment with a TODO and tracking issue for reverting to Nix-packaged ollama when upstream build issues are fixed, (2) version validation to ensure compatibility between the Nix service configuration and Homebrew binary, (3) documentation explaining why this workaround exists.
Agent: 🏛 Architecture

(lib.getExe ollamaHomebrew)
"serve"
];
KeepAlive = true;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

With KeepAlive=true, if the Homebrew binary is missing or fails immediately, launchd will continuously restart the service, potentially consuming system resources. Consider adding ThrottleInterval or StartInterval to prevent rapid restart loops, or implement a more sophisticated health check that allows graceful degradation when Homebrew dependencies are missing.
Agent: 🏛 Architecture

text = ''
set -euo pipefail

if [ -x /opt/homebrew/bin/ollama ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Medium

The hard-coded Homebrew paths assume standard installation locations. Consider using command -v ollama or checking additional paths to handle non-standard Homebrew installations (e.g., different architectures or custom prefixes). This would make the wrapper more robust across different macOS configurations.
Agent: 🏛 Architecture

@shunkakinoki
shunkakinoki merged commit 6707749 into main Nov 26, 2025
21 checks passed
@shunkakinoki
shunkakinoki deleted the ollama-config branch November 26, 2025 05:17
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