Skip to content

Instantly share code, notes, and snippets.

@Hogeyama
Created April 2, 2026 13:31
Show Gist options
  • Select an option

  • Save Hogeyama/6df384193d0853f65d9c803bf7fe46ee to your computer and use it in GitHub Desktop.

Select an option

Save Hogeyama/6df384193d0853f65d9c803bf7fe46ee to your computer and use it in GitHub Desktop.
NixOS + Playwright CLI demo
use flake
PATH_add node_modules/.bin
.pnpm-store/
node_modules/
.playwright/cli.config.json
.playwright-cli/
{
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
'';
};
};
}
{
"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