Skip to content

Add Tailscale support for macOS and Linux - #374

Merged
shunkakinoki merged 3 commits into
mainfrom
claude/add-tailscale-setup-01WhvQW2YYRcVgTm31m6dcRd
Nov 27, 2025
Merged

Add Tailscale support for macOS and Linux#374
shunkakinoki merged 3 commits into
mainfrom
claude/add-tailscale-setup-01WhvQW2YYRcVgTm31m6dcRd

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Nov 27, 2025

Copy link
Copy Markdown
Owner
  • Add tailscale cask to Homebrew config for macOS
  • Create tailscale service module for home-manager (Linux)
  • Enable services.tailscale in NixOS configuration

Summary by cubic

Enable Tailscale on macOS and Linux to provide secure VPN and SSH access. Installs the macOS cask and adds Tailscale to Home Manager packages.

  • New Features
    • macOS: Add Tailscale Homebrew cask.
    • Linux (Home Manager): Install Tailscale CLI; daemon setup remains system-level.

Written for commit 840ca3d. Summary will update automatically on new commits.

- Add tailscale cask to Homebrew config for macOS
- Create tailscale service module for home-manager (Linux)
- Enable services.tailscale in NixOS configuration
Copilot AI review requested due to automatic review settings November 27, 2025 02:48
@coderabbitai

coderabbitai Bot commented Nov 27, 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 Tailscale as an available package for macOS and Linux environments.

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

Walkthrough

The pull request adds the tailscale package to two configuration files: adding it to the Homebrew casks list in nix-darwin and including it in home-manager packages with conditional Linux availability.

Changes

Cohort / File(s) Summary
nix-darwin Homebrew Configuration
nix-darwin/config/homebrew.nix
Adds tailscale to the Homebrew casks list
home-manager Package Configuration
home-manager/packages/default.nix
Adds tailscale to top-level pkgs list and to the lib.optionals (stdenv.isLinux) block for Linux conditional availability

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

  • Straightforward package additions following existing patterns in both configuration files
  • No logic changes or complex interactions introduced

Poem

🐰✨ A tail of scales now added with care,
To Homebrew kegs and packages fair,
On Linux it speeds, through networks it bounds,
Configuration hops all securely around! 🌐

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add Tailscale support for macOS and Linux' directly and clearly matches the changeset which adds Tailscale to both macOS Homebrew config and Linux home-manager packages.
Description check ✅ Passed The description is directly related to the changeset, detailing the addition of Tailscale cask for macOS and Tailscale package for Linux home-manager, matching the actual changes made.
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 claude/add-tailscale-setup-01WhvQW2YYRcVgTm31m6dcRd

📜 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 f94fda5 and 840ca3d.

📒 Files selected for processing (1)
  • home-manager/packages/default.nix (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.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/packages/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

  • home-manager/packages/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/packages/default.nix
🧠 Learnings (2)
📓 Common learnings
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
📚 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 must include all necessary dependencies in their configuration

Applied to files:

  • home-manager/packages/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). (10)
  • GitHub Check: lua-hammerspoon
  • GitHub Check: lua-neovim
  • GitHub Check: nix-nixos
  • GitHub Check: nix-linux
  • GitHub Check: nix-darwin
  • GitHub Check: e2e-run (NixOS, 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: e2e-run (Ubuntu, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
🔇 Additional comments (1)
home-manager/packages/default.nix (1)

77-90: Linux‑only tailscale package addition looks correct and matches cross‑platform strategy

Adding tailscale to the lib.optionals stdenv.isLinux list preserves formatting/ordering and cleanly scopes the Nix package to Linux, leaving macOS to be handled via Homebrew in the nix-darwin config, which aligns with the “use Homebrew only for macOS applications” guidance. Based on learnings, this separation is appropriate and I don’t see further changes needed in this file.


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 significantly enhances the configuration by integrating Tailscale across various operating systems. It ensures that Tailscale can be consistently managed and deployed, whether on macOS via Homebrew, on Linux through home-manager for user-level tools, or as a fully enabled system service on NixOS. The changes streamline secure network access and management within the existing infrastructure.

Highlights

  • macOS Tailscale Support: Tailscale has been added to the Homebrew cask list in the nix-darwin configuration, enabling its installation and management on macOS systems.
  • Linux Home-Manager Service: A new home-manager service module for Tailscale has been introduced, which will install the Tailscale CLI tools on Linux systems (excluding NixOS, where system-level configuration is used).
  • NixOS Tailscale Service Activation: The services.tailscale option has been explicitly enabled in the NixOS configuration, integrating Tailscale as a system service for secure network access and SSH.
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 Nov 27, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Adds Tailscale support for macOS and Linux, enabling secure VPN and SSH access by installing the macOS cask and integrating it into Home Manager for Linux.

What changed?

  • home-manager/services/default.nix: Updated to include and enable the new tailscale service.
  • home-manager/services/tailscale/default.nix: Introduced a new Home Manager module for Tailscale, conditionally installing the tailscale package on Linux and clarifying macOS/NixOS management.
  • hosts/nixos/default.nix: Enabled the Tailscale VPN service in the NixOS configuration for secure network access and SSH.
  • nix-darwin/config/homebrew.nix: Updated to include "tailscale" in the list of Homebrew cask applications.

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 adds support for Tailscale across macOS, NixOS, and non-NixOS Linux environments, which is a great addition. The changes are well-structured, with separate configurations for each platform.

My review includes two main points:

  1. A logic correction in the new home-manager module for Tailscale to prevent redundant package installation on NixOS systems. This is an important fix to ensure the configuration is clean and correct.
  2. A minor style suggestion to maintain alphabetical order in the Homebrew cask list for better readability and consistency.

Overall, the changes are good, and with the suggested improvements, the implementation will be more robust.

Comment on lines +1 to +10
{ pkgs }:
let
inherit (pkgs) lib;
in
# On macOS, Tailscale is installed via Homebrew cask which manages the app and daemon.
# On Linux (non-NixOS), we install the CLI tools; the tailscaled daemon requires system-level setup.
# For NixOS, enable services.tailscale in the system configuration.
lib.mkIf pkgs.stdenv.isLinux {
home.packages = [ pkgs.tailscale ];
}

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.

high

The current implementation of this module will cause the tailscale package to be installed redundantly on NixOS systems. The system-level services.tailscale.enable = true; option already ensures the package is installed. The comment in the file correctly states the desired behavior, but the lib.mkIf pkgs.stdenv.isLinux condition is too broad as it also matches NixOS.

To fix this, the module should be refactored to be a proper home-manager module function. This allows it to access the config object from the module system and conditionally install the package only on non-NixOS Linux systems by inspecting the config object. This aligns with the intent described in the comments and avoids package redundancy.

{ pkgs }:
{ lib, config, ... }:
{
  # On macOS, Tailscale is installed via Homebrew cask which manages the app and daemon.
  # On Linux (non-NixOS), we install the CLI tools; the tailscaled daemon requires system-level setup.
  # For NixOS, enable services.tailscale in the system configuration.
  home.packages = lib.mkIf (pkgs.stdenv.isLinux && !(config.system ? stateVersion)) [
    pkgs.tailscale
  ];
}

"windsurf"
"zed"
"zoom"
"tailscale"

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 consistency and easier maintenance, the items in the casks list should be kept in alphabetical order. Please move "tailscale" to its correct sorted position in the list (after "slack").

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 adds Tailscale VPN support across all platforms in the dotfiles configuration: macOS via Homebrew cask, NixOS via system services, and non-NixOS Linux via home-manager packages.

Key changes:

  • Added Tailscale cask to Homebrew configuration for macOS
  • Enabled services.tailscale in NixOS system configuration
  • Created conditional home-manager module to install Tailscale CLI on Linux (non-NixOS) systems

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
nix-darwin/config/homebrew.nix Adds "tailscale" cask to install Tailscale app on macOS
hosts/nixos/default.nix Enables Tailscale service for NixOS systems with explanatory comment
home-manager/services/tailscale/default.nix New module that conditionally installs Tailscale CLI tools on Linux (non-NixOS) systems
home-manager/services/default.nix Imports and includes the new Tailscale module in the services list

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

"windsurf"
"zed"
"zoom"
"tailscale"

Copilot AI Nov 27, 2025

Copy link

Choose a reason for hiding this comment

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

The casks list appears to be alphabetically sorted. "tailscale" should be placed after "slack" (line 80) and before "visual-studio-code" (line 81) to maintain alphabetical order.

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

🧹 Nitpick comments (2)
nix-darwin/config/homebrew.nix (1)

88-88: Consider maintaining alphabetical order in the casks list.

The "tailscale" cask is added at the end of the list, but the list appears to be alphabetically sorted. For consistency, "tailscale" should be positioned between "sf-symbols" (line 79) and "visual-studio-code" (line 81).

Apply this diff to maintain alphabetical order:

       "sf-symbols"
       "slack"
+      "tailscale"
       "visual-studio-code"
       "vscodium"
       "warp"
       "wezterm"
       "windsurf"
       "zed"
       "zoom"
-      "tailscale"

As per coding guidelines, attribute sets and lists should be sorted alphabetically in Nix files.

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

1-10: Consider enhancing module documentation and structure.

The module correctly handles platform-specific Tailscale installation (Homebrew on macOS, package on Linux, system service on NixOS). However, the module structure is unconventional for a home-manager service module:

  1. Documentation: The comments explain platform-specific installation but could be more comprehensive. Consider adding:

    • Module purpose and usage guidelines
    • When users should enable this vs. system-level configuration
    • Dependencies and prerequisites
  2. Module Structure: The current implementation directly returns a conditional attribute set rather than following the typical home-manager module pattern with config and options declarations. While this works for simple package installation, it doesn't provide:

    • Configurable options (no mkOption usage)
    • Type safety for module inputs
    • User-facing enable/disable toggle

Recommendation: If this is consistent with other service modules in your codebase (e.g., code-syncer, dotfiles-updater), this pattern may be acceptable. Otherwise, consider refactoring to follow standard home-manager module conventions.

As per coding guidelines, service configurations should include proper service definitions, handle dependencies correctly, and document service parameters. Consider this structure:

{ config, lib, pkgs, ... }:
let
  cfg = config.services.tailscale;
in
{
  options.services.tailscale = {
    enable = lib.mkEnableOption "Tailscale VPN integration (Linux package only)";
  };

  config = lib.mkIf (cfg.enable && pkgs.stdenv.isLinux) {
    # On macOS, Tailscale is installed via Homebrew cask which manages the app and daemon.
    # On Linux (non-NixOS), we install the CLI tools; the tailscaled daemon requires system-level setup.
    # For NixOS, enable services.tailscale in the system configuration.
    home.packages = [ pkgs.tailscale ];
  };
}
📜 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 a666480 and f94fda5.

📒 Files selected for processing (4)
  • home-manager/services/default.nix (1 hunks)
  • home-manager/services/tailscale/default.nix (1 hunks)
  • hosts/nixos/default.nix (1 hunks)
  • nix-darwin/config/homebrew.nix (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/default.nix
  • hosts/nixos/default.nix
  • nix-darwin/config/homebrew.nix
  • home-manager/services/tailscale/default.nix
**/default.nix

📄 CodeRabbit inference engine (CLAUDE.md)

Use default.nix files for module exports

Files:

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

📄 CodeRabbit inference engine (CLAUDE.md)

Use Homebrew only for macOS-specific applications

Files:

  • nix-darwin/config/homebrew.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/tailscale/default.nix
🧠 Learnings (14)
📚 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/default.nix
  • hosts/nixos/default.nix
  • home-manager/services/tailscale/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/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/default.nix
  • home-manager/services/tailscale/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/default.nix
  • home-manager/services/tailscale/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/default.nix
  • home-manager/services/tailscale/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:

  • nix-darwin/config/homebrew.nix
  • home-manager/services/tailscale/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/tailscale/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/modules/**/*.nix : Document all custom modules and options

Applied to files:

  • home-manager/services/tailscale/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/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:

  • home-manager/services/tailscale/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/tailscale/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 **/default.nix : Use `default.nix` files for module exports

Applied to files:

  • home-manager/services/tailscale/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/modules/*/default.nix : Custom modules must be located in `home-manager/modules/<name>/` and must include a `default.nix` file

Applied to files:

  • home-manager/services/tailscale/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/modules/**/default.nix : Custom modules should include proper option types and document all options

Applied to files:

  • home-manager/services/tailscale/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/tailscale/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). (13)
  • GitHub Check: Mesa Review
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Agent
  • 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: lua-neovim
  • GitHub Check: lua-hammerspoon
  • GitHub Check: nix-darwin
  • GitHub Check: e2e-run (NixOS, ubuntu-latest)
  • GitHub Check: e2e-run (MacOS, macos-latest)
  • GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
🔇 Additional comments (2)
home-manager/services/default.nix (1)

8-8: LGTM! Proper module integration.

The tailscale module is correctly imported and integrated into the services list, maintaining alphabetical order in both the let-binding and the returned list.

Also applies to: 16-16

hosts/nixos/default.nix (1)

97-98: LGTM! Proper NixOS service enablement.

The Tailscale service is correctly enabled for NixOS with a clear comment explaining its purpose. This follows the standard NixOS service configuration pattern.

@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 4 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 a666480...f94fda5

Analysis

  1. Redundant Installation on NixOS: The PR enables Tailscale both at the NixOS system level and through the home-manager module, creating unnecessary duplication and potential version conflicts. The home-manager module should be refined to distinguish between standalone Linux and NixOS.

  2. Incomplete Linux Setup: For standalone Linux systems, the implementation only installs Tailscale CLI tools without addressing the daemon configuration, which requires system-level setup. This leaves users with a non-functional installation unless they separately configure tailscaled.

  3. Platform-Specific Logic Improvements: While the PR correctly handles the three-tier platform architecture, the conditional logic in home-manager/services/tailscale/default.nix needs refinement to avoid the NixOS overlap.

  4. Missing User Guidance: No explicit activation script or post-install guidance is provided for Linux users who need daemon setup instructions.

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

4 files reviewed | 1 comments | Edit Agent SettingsRead Docs

# On macOS, Tailscale is installed via Homebrew cask which manages the app and daemon.
# On Linux (non-NixOS), we install the CLI tools; the tailscaled daemon requires system-level setup.
# For NixOS, enable services.tailscale in the system configuration.
lib.mkIf pkgs.stdenv.isLinux {

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 condition pkgs.stdenv.isLinux will match both standalone Linux systems and NixOS. However, on NixOS hosts, services.tailscale.enable = true (in hosts/nixos/default.nix:98) already installs the tailscale package system-wide. This creates redundant package installation in both system and user profiles.

Consider refining the condition to exclude NixOS:

lib.mkIf (pkgs.stdenv.isLinux && !(builtins.pathExists /etc/NIXOS)) {
  home.packages = [ pkgs.tailscale ];
}

This ensures standalone Linux users get CLI tools via home-manager, while NixOS users rely solely on the system service installation.
Agent: 🏛 Architecture

@shunkakinoki
shunkakinoki enabled auto-merge (squash) November 27, 2025 04:38
@shunkakinoki
shunkakinoki merged commit be9b849 into main Nov 27, 2025
27 checks passed
@shunkakinoki
shunkakinoki deleted the claude/add-tailscale-setup-01WhvQW2YYRcVgTm31m6dcRd branch November 27, 2025 05:20
@coderabbitai coderabbitai Bot mentioned this pull request Nov 29, 2025
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.

3 participants