|
| 1 | +# This is a Nix configuration file. It is used to define the environment |
| 2 | +# for the project. It is a declarative way to define the dependencies. |
| 3 | +# It is used by the `nix develop` command to create a development environment |
| 4 | +# with all the dependencies needed for the project. |
| 5 | + |
| 6 | +# To update the dependencies, run `nix flake update`. |
| 7 | + |
| 8 | +# Note: keep the playwright version in package.json syncpack the same as the nix version |
| 9 | +# We don't need to have the latest playwright all the time so not having to download |
| 10 | +# all the browsers on every version bump is a good thing. |
1 | 11 | {
|
2 | 12 | inputs = {
|
3 |
| - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; |
| 13 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; |
4 | 14 | rust-overlay.url = "github:oxalica/rust-overlay";
|
5 | 15 | };
|
6 | 16 |
|
|
23 | 33 | nodejs_20
|
24 | 34 | corepack_20
|
25 | 35 |
|
| 36 | + # Playwright for the end-to-end tests |
| 37 | + playwright-driver.browsers |
| 38 | + |
26 | 39 | # Qwik optimizer deps
|
27 | 40 | wasm-pack
|
28 | 41 | # Provides rustc and cargo
|
|
34 | 47 | targets = [ "wasm32-unknown-unknown" ];
|
35 | 48 | })
|
36 | 49 | ];
|
| 50 | + # https://github.com/microsoft/playwright/issues/5501 |
| 51 | + shellHook = '' |
| 52 | + export PATH=$PWD/node_modules/.bin:$PATH |
| 53 | + export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers} |
| 54 | + export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true |
| 55 | + pwNixVersion=${pkgs.playwright-driver.version} |
| 56 | + pwNpmVersion=$(${pkgs.jq}/bin/jq -r .version node_modules/@playwright/test/package.json 2>/dev/null) |
| 57 | + if [ -n "$pwNpmVersion" ] && [ "$pwNpmVersion" != "$pwNixVersion" ]; then |
| 58 | + echo "!!! Playwright version mismatch: $pwNpmVersion (nodejs) != $pwNixVersion (nix). Please fix." >&2 |
| 59 | + fi |
| 60 | + ''; |
37 | 61 | };
|
38 | 62 | };
|
39 | 63 | in
|
|
0 commit comments