[PR #238] [MERGED] feat: add Nix flake for reproducible dev environment #410

Closed
opened 2026-05-06 12:39:40 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/238
Author: @peri-Bot
Created: 3/3/2026
Status: Merged
Merged: 3/4/2026
Merged by: @southpolesteve

Base: mainHead: feat/nix-flake


📝 Commits (3)

  • 4c83933 feat: add Nix flake for reproducible dev environment
  • 629ae4c fix: use corepack for exact pnpm version pinning
  • 9332118 chore: address review feedback on Nix dev shell

📊 Changes

6 files changed (+193 additions, -0 deletions)

View changed files

.envrc (+1 -0)
📝 .gitignore (+6 -0)
flake.lock (+78 -0)
flake.nix (+32 -0)
nix/devShell.nix (+68 -0)
shell.nix (+8 -0)

📄 Description

This PR introduces Nix to provide a fully deterministic, reproducible development environment.

Given the heavy reliance on Playwright for E2E testing and the AI-driven nature of this project, ensuring a flawless local environment is critical. This setup guarantees that human contributors and AI agents alike have the exact same Node versions, native dependencies, and Playwright binaries out-of-the-box, eliminating "works on my machine" (or "works for the AI agent") environment drift.

Note: This PR is purely additive. No existing files, package.json scripts, or GitHub CI workflows have been modified. Contributors who do not use Nix can continue using their standard local setups without interruption.

What's included

  • flake.nix & nix/devShell.nix: Running nix develop provisions an isolated shell with exact versions of Node.js 24, pnpm, oxlint, the GitHub CLI (gh), and all system dependencies required for Playwright.
  • nix/checks.nix: Running nix flake check executes the linting, typechecking, and test suites hermetically, ensuring consistent feedback.
  • shell.nix & .envrc: Provides backward compatibility for older Nix installations and seamless integration with direnv (auto-loading the environment upon entering the directory).

How to use (for reviewers)

If you have Nix installed:

  1. Run nix develop (or direnv allow if using direnv).
  2. You will instantly drop into a shell with all project dependencies correctly configured.
  3. Run pnpm install and pnpm test:e2e as usual—Playwright tests will run flawlessly without requiring manual browser/system library installations.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/238 **Author:** [@peri-Bot](https://github.com/peri-Bot) **Created:** 3/3/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `feat/nix-flake` --- ### 📝 Commits (3) - [`4c83933`](https://github.com/cloudflare/vinext/commit/4c83933d6ab9b84966fc8bc24188639fe970c708) feat: add Nix flake for reproducible dev environment - [`629ae4c`](https://github.com/cloudflare/vinext/commit/629ae4ce9ce2226c0c89a787cc8c907fe6fa773b) fix: use corepack for exact pnpm version pinning - [`9332118`](https://github.com/cloudflare/vinext/commit/9332118b9503d1bd53709ca162b0393aec195e58) chore: address review feedback on Nix dev shell ### 📊 Changes **6 files changed** (+193 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `.envrc` (+1 -0) 📝 `.gitignore` (+6 -0) ➕ `flake.lock` (+78 -0) ➕ `flake.nix` (+32 -0) ➕ `nix/devShell.nix` (+68 -0) ➕ `shell.nix` (+8 -0) </details> ### 📄 Description This PR introduces [Nix](https://nixos.org/) to provide a fully deterministic, reproducible development environment. Given the heavy reliance on Playwright for E2E testing and the AI-driven nature of this project, ensuring a flawless local environment is critical. This setup guarantees that human contributors and AI agents alike have the exact same Node versions, native dependencies, and Playwright binaries out-of-the-box, eliminating "works on my machine" (or "works for the AI agent") environment drift. **Note:** This PR is **purely additive**. No existing files, `package.json` scripts, or GitHub CI workflows have been modified. Contributors who do not use Nix can continue using their standard local setups without interruption. ## What's included - **`flake.nix` & `nix/devShell.nix`**: Running `nix develop` provisions an isolated shell with exact versions of Node.js 24, `pnpm`, `oxlint`, the GitHub CLI (`gh`), and all system dependencies required for Playwright. - **`nix/checks.nix`**: Running `nix flake check` executes the linting, typechecking, and test suites hermetically, ensuring consistent feedback. - **`shell.nix` & `.envrc`**: Provides backward compatibility for older Nix installations and seamless integration with `direnv` (auto-loading the environment upon entering the directory). ## How to use (for reviewers) If you have Nix installed: 1. Run `nix develop` (or `direnv allow` if using direnv). 2. You will instantly drop into a shell with all project dependencies correctly configured. 3. Run `pnpm install` and `pnpm test:e2e` as usual—Playwright tests will run flawlessly without requiring manual browser/system library installations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:39:40 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#410
No description provided.