Created
April 2, 2026 13:31
-
-
Save Hogeyama/6df384193d0853f65d9c803bf7fe46ee to your computer and use it in GitHub Desktop.
NixOS + Playwright CLI demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use flake | |
| PATH_add node_modules/.bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .pnpm-store/ | |
| node_modules/ | |
| .playwright/cli.config.json | |
| .playwright-cli/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| inputs = { | |
| nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | |
| }; | |
| outputs = { nixpkgs, ... }: | |
| let | |
| system = "x86_64-linux"; | |
| pkgs = nixpkgs.legacyPackages.${system}; | |
| in | |
| { | |
| devShells.${system}.default = pkgs.mkShell { | |
| packages = [ | |
| pkgs.pnpm | |
| pkgs.nodejs | |
| pkgs.chromium | |
| ]; | |
| shellHook = '' | |
| if [ ! -f .playwright/cli.config.json ]; then | |
| mkdir -p .playwright | |
| cat > .playwright/cli.config.json <<EOF | |
| { | |
| "browser": { | |
| "browserName": "chromium", | |
| "launchOptions": { | |
| "executablePath": "${pkgs.chromium}/bin/chromium", | |
| "chromiumSandbox": false | |
| } | |
| } | |
| } | |
| EOF | |
| fi | |
| ''; | |
| }; | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "nix-playwright-cli", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "keywords": [], | |
| "author": "", | |
| "license": "ISC", | |
| "packageManager": "pnpm@10.33.0", | |
| "dependencies": { | |
| "@playwright/cli": "^0.1.4" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment