Skip to content

fix(clawdbot): add browser executablePath and use configOverrides - #553

Merged
shunkakinoki merged 2 commits into
mainfrom
fix/clawdbot-browser-executable-path
Jan 12, 2026
Merged

fix(clawdbot): add browser executablePath and use configOverrides#553
shunkakinoki merged 2 commits into
mainfrom
fix/clawdbot-browser-executable-path

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Jan 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes browser tool not finding chromium on Linux.

Changes

  • Use `configOverrides` instead of `config` (upstream nix-clawdbot bug: `config` option isn't merged into output JSON)
  • Add explicit `executablePath` for chromium to fix browser detection
  • Enables headless browser on Linux for web search capabilities

Testing

Built and verified config output includes:
```json
"browser": {
"enabled": true,
"executablePath": "/nix/store/.../chromium",
"headless": true
}
```


Summary by cubic

Fixes Clawdbot’s browser on Linux so Chromium is found and headless browsing works. Restores web search capability.

  • Bug Fixes
    • Use configOverrides instead of config (upstream nix-clawdbot doesn’t merge config into output).
    • On Linux, set browser.executablePath to the Chromium binary and keep headless=true; do not set executablePath on macOS.
    • Preserve Linux gateway.bind=lan.

Written for commit 9eef433. Summary will update on new commits.

Copilot AI review requested due to automatic review settings January 11, 2026 23:31
@coderabbitai

coderabbitai Bot commented Jan 11, 2026

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Reworked clawdbot configuration structure to use an override-style configuration for clearer runtime behavior.
    • Chromium is now explicitly set as the browser executable for the bot.
    • Gateway settings are applied conditionally on Linux systems to align network behavior with platform expectations.

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

Walkthrough

Replaces the inline config in the clawdbot Home Manager module with a configOverrides block, sets browser.executablePath to Chromium on Linux, and moves gateway settings into a conditionally merged gateway attribute via lib.optionalAttrs for Linux-only application.

Changes

Cohort / File(s) Summary
Module config update
home-manager/modules/clawdbot/default.nix
Replace inline config with configOverrides; add browser.executablePath = "${pkgs.chromium}/bin/chromium" behind a Linux condition using lib.optionalAttrs; move gateway settings into a separately merged gateway attribute (Linux-only) and retain explanatory comment about configOverrides.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through Nix with nimble feet,
Moved configs where the overrides meet,
Chromium found its proper track,
Linux gates now fold right back,
A tidy module — carrots for a treat! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing clawdbot by adding browser executablePath and switching to configOverrides.
Description check ✅ Passed The description is directly related to the changeset, explaining the bug fix, the specific changes made, and testing verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/clawdbot-browser-executable-path

📜 Recent review details

Configuration used: Organization 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 aff45ed and 9eef433.

📒 Files selected for processing (1)
  • home-manager/modules/clawdbot/default.nix
🚧 Files skipped from review as they are similar to previous changes (1)
  • home-manager/modules/clawdbot/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). (11)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: nix-nixos
  • GitHub Check: lua-neovim
  • GitHub Check: lua-neovim-test
  • GitHub Check: shell-lint
  • GitHub Check: shell-test
  • GitHub Check: nix-linux
  • 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 (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)

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 addresses a critical issue preventing the clawdbot browser tool from functioning correctly on Linux environments. It refactors the configuration approach to use "configOverrides" to ensure settings are properly applied and explicitly defines the Chromium executable path, thereby enabling headless browser operations for web search functionalities on Linux.

Highlights

  • Configuration Mechanism: Switched from using "config" to "configOverrides" for clawdbot settings due to an upstream bug where "config" values were not being merged correctly into the final output JSON.
  • Browser Executable Path: Explicitly set the "executablePath" for the browser to point to the Chromium binary ("${pkgs.chromium}/bin/chromium"), resolving issues with the browser tool not being found on Linux systems.
  • Headless Browser on Linux: Ensured that the browser is configured to run in headless mode when deployed on Linux, which is essential for web search capabilities in environments like CI or servers.
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.

- Use configOverrides instead of config (upstream nix-clawdbot bug: config isn't merged into output)
- Add explicit executablePath for chromium to fix browser detection
- Enables headless browser on Linux for web search capabilities
@mesa-dot-dev

mesa-dot-dev Bot commented Jan 11, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

Fixes Clawdbot's browser on Linux to correctly find Chromium and enable headless browsing, restoring web search capabilities, by updating its Nix configuration.

What changed?

  • home-manager/modules/clawdbot/default.nix: The clawdbot module was updated to use configOverrides and explicitly set the browser's executablePath to Chromium. The gateway configuration for LAN binding on Linux was also refactored for conditional application.

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 correctly addresses the issue of finding the Chromium executable on Linux by adding an explicit executablePath. The switch from config to configOverrides is well-justified by the comment regarding the upstream nix-clawdbot behavior. The refactoring to use lib.optionalAttrs for the conditional gateway configuration is a good, idiomatic Nix pattern that ensures a plain attribute set is generated, which seems to be what's required here. The changes look solid and effectively resolve the described problem.

@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)
home-manager/modules/clawdbot/default.nix (1)

67-78: Well-documented configuration change with proper conditional merging.

The switch from config to configOverrides is clearly documented with the NOTE comment explaining the upstream issue. The use of lib.optionalAttrs pkgs.stdenv.isLinux for the gateway configuration is idiomatic Nix for conditional attribute sets.

One minor suggestion per coding guidelines: attribute sets should be sorted alphabetically. The browser block attributes could be reordered:

♻️ Suggested alphabetical ordering
       configOverrides = {
         browser = {
           enabled = true;
+          executablePath = "${pkgs.chromium}/bin/chromium";
           headless = pkgs.stdenv.isLinux;
-          executablePath = "${pkgs.chromium}/bin/chromium";
         };
       } // lib.optionalAttrs pkgs.stdenv.isLinux {
📜 Review details

Configuration used: Organization 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 9ec365f and aff45ed.

📒 Files selected for processing (1)
  • home-manager/modules/clawdbot/default.nix
🧰 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/modules/clawdbot/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/modules/clawdbot/default.nix
home-manager/modules/*/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Custom modules must be located in home-manager/modules/<name>/ and must include a default.nix file

Files:

  • home-manager/modules/clawdbot/default.nix
home-manager/modules/**/default.nix

📄 CodeRabbit inference engine (.cursor/rules/home-manager.mdc)

Custom modules should include proper option types and document all options

Each module in home-manager/modules/ should have a clear default.nix with proper option declarations following the home-manager module structure

Files:

  • home-manager/modules/clawdbot/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/modules/clawdbot/default.nix
home-manager/modules/**/*.nix

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

Document all custom modules and options

Files:

  • home-manager/modules/clawdbot/default.nix
🧠 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:

  • home-manager/modules/clawdbot/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/modules/clawdbot/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/modules/clawdbot/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/modules/clawdbot/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). (16)
  • GitHub Check: Agent
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Mesa Review
  • GitHub Check: lua-neovim-test
  • GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
  • GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
  • GitHub Check: nix-linux
  • GitHub Check: nix-darwin
  • GitHub Check: nix-nixos
  • GitHub Check: shell-lint
  • GitHub Check: shell-test
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: lua-hammerspoon
  • GitHub Check: lua-neovim

Comment on lines 69 to 73
browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
executablePath = "${pkgs.chromium}/bin/chromium";
};

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

🧩 Analysis chain

🏁 Script executed:

# First, let's look at the full clawdbot module to understand the context
cat home-manager/modules/clawdbot/default.nix

Repository: shunkakinoki/dotfiles

Length of output: 3752


🏁 Script executed:

# Check chromium references in the codebase
rg -n "chromium" --type nix -C 2

Repository: shunkakinoki/dotfiles

Length of output: 756


🏁 Script executed:

# Check the flake.nix to see how packages are defined
head -100 flake.nix

Repository: shunkakinoki/dotfiles

Length of output: 2646


🏁 Script executed:

# Check if there are Darwin-specific handling in the module
rg -n "isDarwin\|isLinux\|stdenv" home-manager/modules/clawdbot/default.nix

Repository: shunkakinoki/dotfiles

Length of output: 47


🏁 Script executed:

# Check if chromium is available on macOS in nixpkgs and if there's a Darwin alternative
rg -n "chromium" home-manager/packages/default.nix -B 5 -A 5

Repository: shunkakinoki/dotfiles

Length of output: 263


🏁 Script executed:

# Check if there's any Darwin-specific browser configuration elsewhere
rg -n "darwin\|isDarwin" home-manager/modules/clawdbot/default.nix -B 2 -A 2

Repository: shunkakinoki/dotfiles

Length of output: 47


🏁 Script executed:

# Check the home-manager/packages/default.nix to understand full context
cat home-manager/packages/default.nix

Repository: shunkakinoki/dotfiles

Length of output: 1432


Make browser configuration platform-conditional or provide Darwin alternative.

The code unconditionally enables the browser and references ${pkgs.chromium} on line 72, but chromium is only available in the Linux package set (lib.optionals (stdenv.isLinux && !isCI) in home-manager/packages/default.nix). Since clawdbot runs on both Darwin and Linux (via launchd.enable and systemd.enable conditionals), this configuration will fail on macOS builds.

Either guard the browser configuration with pkgs.stdenv.isLinux, provide a Darwin-specific browser path, or ensure chromium is available on all supported platforms.

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 fixes browser tool detection on Linux by switching from config to configOverrides (to work around an upstream nix-clawdbot bug) and adding an explicit executablePath for chromium.

Changes:

  • Replace config with configOverrides to work around upstream module bug where config option isn't merged into output JSON
  • Add explicit executablePath pointing to chromium binary for browser detection
  • Refactor gateway configuration to use lib.optionalAttrs instead of nested lib.mkIf

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

browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
executablePath = "${pkgs.chromium}/bin/chromium";

Copilot AI Jan 11, 2026

Copy link

Choose a reason for hiding this comment

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

The executablePath is unconditionally set to chromium for all platforms, but chromium is only installed on Linux (see home-manager/packages/default.nix line 108). On macOS, this will cause a build failure since pkgs.chromium won't be available. The executablePath should only be set for Linux systems, similar to how the headless property is conditionally set.

Copilot uses AI. Check for mistakes.

@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 9ec365f...aff45ed

Analysis

  1. The PR sets executablePath unconditionally to Chromium's path without checking if Chromium is actually installed on the platform (particularly an issue for macOS where Chromium isn't installed)

  2. Inconsistent browser strategy between platforms: headless mode is only enabled for Linux, but the code always references Chromium which isn't available on macOS

  3. The change relies on a workaround using configOverrides instead of config due to an upstream bug in nix-clawdbot, creating technical debt that should be tracked

  4. While functional now, the implementation makes Linux-centric assumptions that could cause issues if the CI guard is ever removed or the configuration needs to work in other contexts

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

0 files reviewed | 1 comments | Edit Agent SettingsRead Docs

browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
executablePath = "${pkgs.chromium}/bin/chromium";

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 executablePath is hardcoded to chromium regardless of platform. While this works currently because the module is disabled in CI and chromium is installed on Linux, it creates a subtle dependency assumption. Consider making this conditional:

executablePath = lib.optionalString pkgs.stdenv.isLinux "${pkgs.chromium}/bin/chromium";

This would make the browser configuration more robust if the module's guards change in the future, and better documents that chromium is only available on Linux (per packages/default.nix lines 107-114).

Agent: 🏛 Architecture • Fix in Cursor • Fix in Claude

Prompt for Agent
Task: Address review feedback left on GitHub.
Repository: shunkakinoki/dotfiles#553
File: home-manager/modules/clawdbot/default.nix#L72
Action: Open this file location in your editor, inspect the highlighted code, and resolve the issue described below.

Feedback:
The executablePath is hardcoded to chromium regardless of platform. While this works currently because the module is disabled in CI and chromium is installed on Linux, it creates a subtle dependency assumption. Consider making this conditional:

```nix
executablePath = lib.optionalString pkgs.stdenv.isLinux "${pkgs.chromium}/bin/chromium";

This would make the browser configuration more robust if the module's guards change in the future, and better documents that chromium is only available on Linux (per packages/default.nix lines 107-114).


</details>

@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 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="home-manager/modules/clawdbot/default.nix">

<violation number="1" location="home-manager/modules/clawdbot/default.nix:72">
P1: Chromium is referenced unconditionally, breaking macOS builds where `pkgs.chromium` is unavailable</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
executablePath = "${pkgs.chromium}/bin/chromium";

@cubic-dev-ai cubic-dev-ai Bot Jan 11, 2026

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.

P1: Chromium is referenced unconditionally, breaking macOS builds where pkgs.chromium is unavailable

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At home-manager/modules/clawdbot/default.nix, line 72:

<comment>Chromium is referenced unconditionally, breaking macOS builds where `pkgs.chromium` is unavailable</comment>

<file context>
@@ -64,12 +64,15 @@ lib.mkIf (!env.isCI) {
         browser = {
           enabled = true;
           headless = pkgs.stdenv.isLinux;
+          executablePath = "${pkgs.chromium}/bin/chromium";
         };
-        gateway = lib.mkIf pkgs.stdenv.isLinux {
</file context>

✅ Addressed in 9eef433

Chromium is not available on macOS, so the executablePath should only
be set on Linux. This fixes the macOS e2e build failure.

Also fixes nix formatting.
@shunkakinoki
shunkakinoki enabled auto-merge (squash) January 12, 2026 13:43
@shunkakinoki
shunkakinoki disabled auto-merge January 12, 2026 14:02
@shunkakinoki
shunkakinoki merged commit 8dab6c6 into main Jan 12, 2026
26 of 28 checks passed
@shunkakinoki
shunkakinoki deleted the fix/clawdbot-browser-executable-path branch January 12, 2026 14:02
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