nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 fetchzip,
3 revision,
4 suffix,
5 system,
6 throwSystem,
7 stdenv,
8 autoPatchelfHook,
9 patchelfUnstable,
10
11 alsa-lib,
12 at-spi2-atk,
13 expat,
14 glib,
15 libXcomposite,
16 libXdamage,
17 libXfixes,
18 libXrandr,
19 libgbm,
20 libgcc,
21 libxkbcommon,
22 nspr,
23 nss,
24 ...
25}:
26let
27 linux = stdenv.mkDerivation {
28 name = "playwright-chromium-headless-shell";
29 src = fetchzip {
30 url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
31 stripRoot = false;
32 hash =
33 {
34 x86_64-linux = "sha256-4xPtmjRSbkWLmV2LzVClwjeQcmktZCvDS3gYo+FlkJc=";
35 aarch64-linux = "sha256-rnurwOiST8fdAC5kGC9uR+MRidGtIZCPQLrg+xZbuZQ=";
36 }
37 .${system} or throwSystem;
38 };
39
40 nativeBuildInputs = [
41 autoPatchelfHook
42 patchelfUnstable
43 ];
44
45 buildInputs = [
46 alsa-lib
47 at-spi2-atk
48 expat
49 glib
50 libXcomposite
51 libXdamage
52 libXfixes
53 libXrandr
54 libgbm
55 libgcc.lib
56 libxkbcommon
57 nspr
58 nss
59 ];
60
61 buildPhase = ''
62 cp -R . $out
63 '';
64 };
65
66 darwin = fetchzip {
67 url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
68 stripRoot = false;
69 hash =
70 {
71 x86_64-darwin = "sha256-9MsBmUuaHq3P/eWxGcihzk09e1zuEr4dIMo6ZjSM8ZQ=";
72 aarch64-darwin = "sha256-i8L+C4p8DCcqb5C5B5q+JuX/fTPxhBva2dlFVDkdfQ0=";
73 }
74 .${system} or throwSystem;
75 };
76in
77{
78 x86_64-linux = linux;
79 aarch64-linux = linux;
80 x86_64-darwin = darwin;
81 aarch64-darwin = darwin;
82}
83.${system} or throwSystem