Skip to content

feat: add Nix flake for reproducible development environment#10811

Closed
randomizedcoder wants to merge 5 commits intoRooCodeInc:mainfrom
randomizedcoder:nix
Closed

feat: add Nix flake for reproducible development environment#10811
randomizedcoder wants to merge 5 commits intoRooCodeInc:mainfrom
randomizedcoder:nix

Conversation

@randomizedcoder
Copy link

@randomizedcoder randomizedcoder commented Jan 17, 2026

Related GitHub Issue

Closes: #10810

Roo Code Task Context (Optional)

This PR was developed with assistance from an AI coding assistant.

Description

This PR adds a Nix flake (flake.nix) to provide a reproducible development environment for contributors.

Demo video: https://youtu.be/izhaXYkqT_4

Key features:

  • Dev shell (nix develop): Provides Node.js 20.x, pnpm, ripgrep, Chromium, and all native build dependencies
  • VSIX build (nix build .#vsix): Reproducible extension packaging using fetchPnpmDeps and pnpmConfigHook
  • CI checks (nix flake check): Lint, typecheck, test, and format checks
  • Maintenance helper (nix run .#update-deps): Automates updating flake.lock and pnpm dependency hash
  • Overlay: For NixOS/home-manager integration

Implementation details:

  • Uses lib.cleanSourceWith for efficient source filtering
  • Disables pnpm's manage-package-manager-versions to work in Nix's sandboxed builds
  • Platform-aware Chromium path for Puppeteer tests
  • Includes TypeScript and Nix language servers in dev shell for better editor integration

Test Procedure

  1. Install Nix (if not already installed):

    sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon
  2. Clone the repo:

    git clone https://github.com/randomizedcoder/Roo-Code.git
    cd Roo-Code
    git checkout nix
  3. Build the VSIX package:

    nix build .#vsix

    (If flakes aren't enabled: nix --extra-experimental-features 'nix-command flakes' build .#vsix)

  4. Verify the output:

    ls result/
    # Should show: roo-cline-3.41.2.vsix
  5. Install the extension:

    code --install-extension result/*.vsix

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Demo video: https://youtu.be/izhaXYkqT_4

Demonstrates:

  • Entering the dev shell with nix develop
  • Building the VSIX with nix build .#vsix
  • Installing the extension into VS Code

Documentation Updates

  • Yes, documentation updates are required.
    • Updated README.md with "Nix Flake" section
    • Updated CHANGELOG.md with entry for this feature

Additional Notes

  • The flake supports x86_64-linux, aarch64-linux, x86_64-darwin, and aarch64-darwin
  • Users without flakes enabled can use: nix --extra-experimental-features 'nix-command flakes' <command>
  • Pre-built extension also available in nixpkgs via vscode-extensions.rooveterinaryinc.roo-cline

Get in Touch

Reply to pull request


Important

Adds a Nix flake for a reproducible development environment, updating README.md and CHANGELOG.md with usage instructions.

  • Behavior:
    • Adds flake.nix for reproducible development environment with Node.js, pnpm, and build tools.
    • Supports nix develop, nix build .#vsix, and nix flake check for development, building, and CI checks.
    • Includes maintenance command nix run .#update-deps to update dependencies.
  • Documentation:
    • Updates README.md with instructions for using the Nix flake.
    • Adds entry in CHANGELOG.md for the Nix flake feature.
  • Files:
    • Adds flake.nix and flake.lock for Nix flake configuration.

This description was created by Ellipsis for c5fa177. You can customize this summary. It will automatically update as commits are pushed.

Start a new Roo Code Cloud session on this branch

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Documentation Improvements or additions to documentation Enhancement New feature or request labels Jan 17, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 17, 2026

Rooviewer Clock   See task on Roo Cloud

Review completed. All previously identified issues have been addressed. No new issues found in recent changes.

  • Darwin (macOS) platform support is broken due to Chromium dependency in devShell, test check, and chromiumPath variable. Chromium is not available in nixpkgs for Darwin platforms.
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

flake.nix Outdated
pkg-config
gnumake
turbo
chromium
Copy link
Contributor

Choose a reason for hiding this comment

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

Chromium is not available in nixpkgs for Darwin (macOS) platforms. Since the flake uses eachDefaultSystem which includes x86_64-darwin and aarch64-darwin, this will cause nix develop to fail on macOS systems with an error like "chromium is not available for the platform".

Consider making Chromium conditional on Linux, or use lib.optionals pkgs.stdenv.isLinux [ chromium ] here. The same issue applies to the chromiumPath variable and the test check's nativeBuildInputs.

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph
Copy link
Collaborator

@roomote revert the changes to readme and changelog

@roomote
Copy link
Contributor

roomote bot commented Jan 25, 2026

Fixaroo Clock   See task on Roo Cloud

Reverted changes to README.md and CHANGELOG.md as requested. All local checks passed.

View commit | Revert commit

@randomizedcoder
Copy link
Author

@hannesrudolph - I managed to fix the test errors I was getting, which required upgrading the turbo project. I think/hope this will improve the Roo code project overall

@randomizedcoder
Copy link
Author

@hannesrudolph Sorry, can you see why the Windows tests are failing? My guess would be something about turbo version update

image

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 20, 2026
@hannesrudolph
Copy link
Collaborator

Hey Dave, appreciate the effort here. After thinking it through we've decided not to move forward with the nix support. It's not something we need as a team, and we're already carrying a fair bit in the plugin that doesn't apply to the general user — we don't want to add more in that direction. Closing this one out, but genuinely appreciate the contribution.

@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements or additions to documentation Enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants