1{
2 lib,
3 stdenv,
4 fetchzip,
5 firefox-bin,
6 suffix,
7 revision,
8 system,
9 throwSystem,
10}:
11let
12 firefox-linux = stdenv.mkDerivation {
13 name = "playwright-firefox";
14 src = fetchzip {
15 url = "https://playwright.azureedge.net/builds/firefox/${revision}/firefox-${
16 "ubuntu-22.04" + (lib.removePrefix "linux" suffix)
17 }.zip";
18 hash =
19 {
20 x86_64-linux = "sha256-j7gOuXMyftNQencgfpk8Y4ED2LuT7TAa30IPyzmir48=";
21 aarch64-linux = "sha256-deIUGKBrp56TsDr61cbNbRRSRcVpSoa6pdmMk4oB/Eg=";
22 }
23 .${system} or throwSystem;
24 };
25
26 inherit (firefox-bin.unwrapped)
27 nativeBuildInputs
28 buildInputs
29 runtimeDependencies
30 appendRunpaths
31 patchelfFlags
32 ;
33
34 buildPhase = ''
35 mkdir -p $out/firefox
36 cp -R . $out/firefox
37 '';
38 };
39 firefox-darwin = fetchzip {
40 url = "https://playwright.azureedge.net/builds/firefox/${revision}/firefox-${suffix}.zip";
41 stripRoot = false;
42 hash =
43 {
44 x86_64-darwin = "sha256-ljgFoyqCg9kma2cDFodNjbkAeEylIzVdWkS1vU/9Rbg=";
45 aarch64-darwin = "sha256-W2J5APPWEkmoDgBEox6/ygg2xyWpOHZESXFG0tZbj1M=";
46 }
47 .${system} or throwSystem;
48 };
49in
50{
51 x86_64-linux = firefox-linux;
52 aarch64-linux = firefox-linux;
53 x86_64-darwin = firefox-darwin;
54 aarch64-darwin = firefox-darwin;
55}
56.${system} or throwSystem