82 lines
1.4 KiB
Nix
82 lines
1.4 KiB
Nix
{
|
|
fetchzip,
|
|
revision,
|
|
browserVersion,
|
|
system,
|
|
throwSystem,
|
|
stdenv,
|
|
autoPatchelfHook,
|
|
patchelfUnstable,
|
|
|
|
alsa-lib,
|
|
at-spi2-atk,
|
|
expat,
|
|
glib,
|
|
libxcomposite,
|
|
libxdamage,
|
|
libxfixes,
|
|
libxrandr,
|
|
libgbm,
|
|
libgcc,
|
|
libxkbcommon,
|
|
nspr,
|
|
nss,
|
|
...
|
|
}:
|
|
let
|
|
download =
|
|
(import ./browser-downloads.nix {
|
|
name = "chromium-headless-shell";
|
|
inherit revision browserVersion;
|
|
}).${system} or throwSystem;
|
|
|
|
linux = stdenv.mkDerivation {
|
|
name = "playwright-chromium-headless-shell";
|
|
src = fetchzip {
|
|
inherit (download) url stripRoot;
|
|
hash =
|
|
{
|
|
x86_64-linux = "sha256-wnN0SL8QqiFGZdevm06WOhR9o6q34+kHL5ay1mRYnxs=";
|
|
aarch64-linux = "sha256-d9Qr3q4GjtUp2ZVFSq+M2Ap++WKaEscRzEkk4JwXL/E=";
|
|
}
|
|
.${system} or throwSystem;
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
autoPatchelfHook
|
|
patchelfUnstable
|
|
];
|
|
|
|
buildInputs = [
|
|
alsa-lib
|
|
at-spi2-atk
|
|
expat
|
|
glib
|
|
libxcomposite
|
|
libxdamage
|
|
libxfixes
|
|
libxrandr
|
|
libgbm
|
|
libgcc
|
|
libxkbcommon
|
|
nspr
|
|
nss
|
|
];
|
|
|
|
buildPhase = ''
|
|
cp -R . $out
|
|
'';
|
|
};
|
|
|
|
darwin = fetchzip {
|
|
inherit (download) url stripRoot;
|
|
hash = "sha256-qWrMOreqTOFhmFBROlXIPXrM3wqNT7iJJwpelVFke6I=";
|
|
};
|
|
in
|
|
{
|
|
x86_64-linux = linux;
|
|
aarch64-linux = linux;
|
|
aarch64-darwin = darwin;
|
|
}
|
|
.${system} or throwSystem
|