nix-playwright
/nix-playwright
Dodaje uruchamianie istniejących testów e2e Playwright przez Nix: samodzielny tests/shell.nix z playwright-driver.browsers i wpis w justfile, działający na NixOS.
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Dodaje uruchamianie istniejących testów e2e Playwright przez Nix: samodzielny tests/shell.nix z playwright-driver.browsers i wpis w justfile, działający na NixOS.
Oryginalny opis (EN)
Use this when adding Nix-based local runs for an existing Playwright e2e suite. Provides a self-contained `tests/shell.nix` that uses `nixpkgs-latest` for `playwright-driver.browsers`, plus a justfile entry — works on NixOS where `npx playwright install --with-deps` cannot.
Jak działa
- Add a nixpkgs-latest flake input
- tests/shell.nix
- Justfile recipe
- Critical version constraint
- Reference
Podgląd SKILL.md
---
name: nix-playwright
description: Use this when adding Nix-based local runs for an existing Playwright e2e suite. Provides a self-contained `tests/shell.nix` that uses `nixpkgs-latest` for `playwright-driver.browsers`, plus a justfile entry — works on NixOS where `npx playwright install --with-deps` cannot.
---
# Playwright e2e under Nix
For projects that already have a Playwright e2e suite (typically under `tests/`) and need it to run locally on NixOS / pure-Nix hosts, where Playwright's bundled Chromium download depends on `apt-get` + `sudo`.
GitHub Actions CI is left untouched — apt-provided Chromium on Ubuntu runners is cheaper than spinning up a Nix devshell. This skill is for **local** runs (and Nix-based CI like Vira); GHA continues to use its own apt path.
## Add a `nixpkgs-latest` flake input
In top-level `flake.nix`, add an independent pin so the Playwright rev moves on its own cadence (decoupled from the main `nixpkgs` your build uses):
```nix
inputs.nixpkgs-latest.url = "github:nixos/nixpkgs/nixpkgs-unstable";
```
## `tests/shell.nix`
Self-contained. Reads the parent flake's lock to resolve `nixpkgs-latest` without needing a flake context:
```nix
let
lock = builtins.fromJSON (builtins.readFile ../flake.lock);
nixpkgsLocked = lock.nodes.nixpkgs-latest.locked;
pkgs = import (builtins.fetchTree {
type = "github";
inherit (nixpkgsLocked) owner repo rev narHash;
}) { };
in
pkgs.mkShell {
packages = [ pkgs.nodejs ];
PLAYWRIGHT_BROWSERS_PATH = "${pkgs.playwright-driver.browsers}";
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = "1";
}
```
## Justfile recipe
```just
e2e:
nix-shell tests/shell.nix --run "cd tests && { [ -d node_modules ] || npm ci; } && npm test"
```
## Critical version constraint
`pkgs.playwright-driver` version must match the `playwright` version in `tests/package.json`. Drift raises **"browser revision X not found at <PLAYWRIGHT_BROWSERS_PATH>"** at launch.
Bump both together:
1. `nix flake update nixpkgs-latest`
2. Match `playwright` in `tests/package.json` to the new driver version
3. `npm install` in `tests/` to regenerate the lockfile
## Reference
Pattern extracted from [emanote#660](https://github.com/srid/emanote/pull/660).
Wersje
W bazie nie ma innych skilli o nazwie nix-playwright.
Migawka bazy z 13.11.2026 · wersja paczki 27c70c6fcf3f (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100nixos
Pomaga w konfiguracji NixOS i Nix: configuration.nix, flake'i, nixos-rebuild, Home Manager, nix-darwin i naprawę nieudanych przebudów. - 100nix-lab
Pisze i zmienia samodzielne laboratorium Nix z flake: zestaw narzędzi i devShell, z blokadami, Justfile i lokalną bramką. - 100ultimate-nixos
Prowadzi przez konfigurację NixOS i nix-darwin, pakowanie dla nixpkgs, moduły, flake'i i hardening systemu. - 96nix
Pisze i sprawdza kod Nix w plikach .nix, pilnując poprawności konfiguracji. - 90nix-tool-policy
Pilnuje, by narzędzia CLI w repozytorium Nix pochodziły wyłącznie z powłoki deweloperskiej lub nix shell. - 100nix
Pomaga w pracy z kodem Nix: flake'ami, derywacjami, overlayami, NixOS, Home Managerem i modułami nix-darwin.