Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions home-manager/modules/clawdbot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,18 @@ lib.mkIf (!env.isCI) {

# Browser configuration (headless on Linux, GUI on macOS)
# Gateway binds to LAN on Linux for k8s ingress access
config = {
# NOTE: uses configOverrides because upstream nix-clawdbot doesn't merge `config` into output
configOverrides = {
browser = {
enabled = true;
headless = pkgs.stdenv.isLinux;
}
// lib.optionalAttrs 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.

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

};
Comment on lines 69 to 75

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.

gateway = lib.mkIf pkgs.stdenv.isLinux {
}
// lib.optionalAttrs pkgs.stdenv.isLinux {
gateway = {
bind = "lan";
};
};
Expand Down
Loading