nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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-PGTFoSjU2FFRmH7qfWkJsgnGvg3AI+eGrNUwyxRU8PM=";
21 aarch64-linux = "sha256-P5aHwaNZ0KfAVgRVugvAl6FsQu2/7sphwulOVyXiTgg=";
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-MI4HfXLmVEwcoL2jlcrDkfiClEN5rI8YcJiMqzE1xYs=";
45 aarch64-darwin = "sha256-Il7bTQoP6ZlqizduV4iCTrVsymy33RbGQtVSnVXnhTc=";
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