From 2901ee2f4e2d4713b52b09ce37e9f5215c09fa73 Mon Sep 17 00:00:00 2001 From: Raphael Zimmermann Date: Tue, 20 Aug 2024 08:54:18 +0200 Subject: [PATCH] build: Use playwright browser from nixpkgs --- flake.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 2700994..7fa4eeb 100644 --- a/flake.nix +++ b/flake.nix @@ -21,11 +21,14 @@ buildInputs = with pkgs; [nodejs start-server start-server-docker]; shellHook = '' export REPOSITORY_ROOT=$(pwd) + playwright_chromium_revision="$(${pkgs.jq}/bin/jq --raw-output '.browsers[] | select(.name == "chromium").revision' ${pkgs.playwright-driver}/package/browsers.json)" + export PLAYWRIGHT_CHROME_EXECUTABLE_PATH="${pkgs.playwright-driver.browsers}/chromium-$playwright_chromium_revision/chrome-linux/chrome"; + export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers} + export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS ln -fs "$REPOSITORY_ROOT/bin/pre-commit" "$REPOSITORY_ROOT/.git/hooks/pre-commit" ''; }; - # enable formatting via `nix fmt` - formatter = pkgs.alejandra; # or nixpkgs-fmt; + formatter = pkgs.alejandra; }); }