diff --git a/flake.lock b/flake.lock index 999d0e6..cb2a757 100644 --- a/flake.lock +++ b/flake.lock @@ -18,26 +18,79 @@ "type": "github" } }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1723556749, - "narHash": "sha256-+CHVZnTnIYRLYsARInHYoWkujzcRkLY/gXm3s5bE52o=", + "lastModified": 1733808091, + "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4a92571f9207810b559c9eac203d1f4d79830073", + "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.05", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1691371061, + "narHash": "sha256-BxPbPVlBIoneaXIBiHd0LVzA+L4nmvFCNBU6TmQAiMM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5068bc8fe943bde3c446326da8d0ca9c93d5a682", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "playwright": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1729902168, + "narHash": "sha256-Y1l/l2MX7S9eUkB22dAAIHGX3Lwhq58pn5E8/W1nLL4=", + "owner": "pietdevries94", + "repo": "playwright-web-flake", + "rev": "bea9fbe6ebdabdd5029f6df672d776d834553f56", + "type": "github" + }, + "original": { + "owner": "pietdevries94", + "ref": "1.48.2", + "repo": "playwright-web-flake", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "playwright": "playwright" } }, "systems": { @@ -54,6 +107,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 7fa4eeb..6a15932 100644 --- a/flake.nix +++ b/flake.nix @@ -2,17 +2,25 @@ description = "Pixelpact Project Flake"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; flake-utils.url = "github:numtide/flake-utils"; + playwright.url = "github:pietdevries94/playwright-web-flake/1.48.2"; }; outputs = { nixpkgs, flake-utils, + playwright, ... }: flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; + overlay = final: prev: { + inherit (playwright.packages.${system}) playwright-test playwright-driver; + }; + pkgs = import nixpkgs { + inherit system; + overlays = [overlay]; + }; nodejs = pkgs.nodejs_20; start-server = pkgs.writeShellScriptBin "start-server" ''cd $REPOSITORY_ROOT/pixelpact; npm run start''; start-server-docker = pkgs.writeShellScriptBin "start-server-docker" ''cd $REPOSITORY_ROOT/pixelpact; docker compose up --build''; @@ -21,10 +29,9 @@ 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 + export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true + export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=true ln -fs "$REPOSITORY_ROOT/bin/pre-commit" "$REPOSITORY_ROOT/.git/hooks/pre-commit" ''; };