You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
precommit: license-check go-fix go-tidy lint test unstaged-changes
48
54
49
55
################################
@@ -392,7 +398,7 @@ playwright-install:
392
398
@if [ -z"$$PLAYWRIGHT_BROWSERS_PATH" ];then\
393
399
npx playwright install --with-deps;\
394
400
else\
395
-
echo"Skipping playwright install because PLAYWRIGHT_BROWSERS_PATH is set to $$PLAYWRIGHT_BROWSERS_PATH";\
401
+
echo"Skipping playwright install because PLAYWRIGHT_BROWSERS_PATH is set to $$PLAYWRIGHT_BROWSERS_PATH. This should have been handled by nix-develop already to prevent sudo prompt.";\
Copy file name to clipboardExpand all lines: docs/nix-setup.md
+8-25Lines changed: 8 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ make nix-setup
24
24
25
25
This will drop you into a new shell with all the required tools in your `PATH`:
26
26
27
-
- Go (1.26.1)
28
-
- Node.js (24.14.0)
29
-
- OpenJDK 25
27
+
- Go
28
+
- Node.js
29
+
- OpenJDK
30
30
- Terraform, Cloud SDK, Minikube, Skaffold, etc.
31
31
32
32
You can verify the versions by looking at the output message when you enter the shell.
@@ -101,32 +101,15 @@ Instead, rely entirely on your host shell's `direnv` hook:
101
101
102
102
Now, whenever you open a new integrated terminal in VS Code, your shell will automatically load the Nix environment _after_ initialization, ensuring all tools are available.
103
103
104
-
## Playwright WebKit on Nix
105
-
106
-
Playwright's WebKit browser requires some special handling in a Nix environment because it expects libraries that may not match the default versions in Nixpkgs.
107
-
108
-
We have handled this in `flake.nix`:
104
+
## Playwright and Browsers
109
105
110
-
1.**Correct Library Versions**: We use `libxml2_13` instead of the default `libxml2` because it provides the exact `libxml2.so.2` file WebKit expects, avoiding brittle symlink hacks.
111
-
2.**Automatic Patching**: When you enter the shell (`nix develop`), it automatically checks if Playwright browsers are installed in `.nix/browsers`. If found, it patches the `MiniBrowser` wrapper script to preserve your `LD_LIBRARY_PATH` instead of overwriting it.
106
+
Playwright manages its own browser binaries and system dependencies.
112
107
113
-
### Clean Build of the Environment
108
+
When you run `make nix-setup`, it runs `npx playwright install` to download browsers, and `npx playwright install-deps webkit` to install system dependencies for WebKit on the host.
114
109
115
-
If you run into issues with browsers or want to ensure a clean setup:
110
+
We only install dependencies for `webkit` because a full `--with-deps` can fail on newer Linux distributions (like Ubuntu 24.04) due to package name changes (e.g., `libasound2` being replaced by `libasound2t64`).
116
111
117
-
1.**Clean Playwright Cache**: Delete the cached browsers to force a redownload.
118
-
```bash
119
-
rm -rf .nix/browsers
120
-
```
121
-
2. **Re-install Browsers**: Run the install command again (inside `nix develop`).
122
-
```bash
123
-
npx playwright install
124
-
```
125
-
3. **Re-enter Shell**: Exit and re-enter `nix develop` to trigger the automatic patching again!
126
-
```bash
127
-
exit
128
-
nix develop
129
-
```
112
+
This ensures that browsers work correctly without needing complex configuration or patching in the Nix flake.
0 commit comments