Files
nixpkgs/pkgs/development/web/playwright/firefox.nix
2025-07-23 06:06:27 +03:00

57 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchzip,
firefox-bin,
suffix,
revision,
system,
throwSystem,
}:
let
firefox-linux = stdenv.mkDerivation {
name = "playwright-firefox";
src = fetchzip {
url = "https://playwright.azureedge.net/builds/firefox/${revision}/firefox-${
"ubuntu-22.04" + (lib.removePrefix "linux" suffix)
}.zip";
hash =
{
x86_64-linux = "sha256-j7gOuXMyftNQencgfpk8Y4ED2LuT7TAa30IPyzmir48=";
aarch64-linux = "sha256-deIUGKBrp56TsDr61cbNbRRSRcVpSoa6pdmMk4oB/Eg=";
}
.${system} or throwSystem;
};
inherit (firefox-bin.unwrapped)
nativeBuildInputs
buildInputs
runtimeDependencies
appendRunpaths
patchelfFlags
;
buildPhase = ''
mkdir -p $out/firefox
cp -R . $out/firefox
'';
};
firefox-darwin = fetchzip {
url = "https://playwright.azureedge.net/builds/firefox/${revision}/firefox-${suffix}.zip";
stripRoot = false;
hash =
{
x86_64-darwin = "sha256-ljgFoyqCg9kma2cDFodNjbkAeEylIzVdWkS1vU/9Rbg=";
aarch64-darwin = "sha256-W2J5APPWEkmoDgBEox6/ygg2xyWpOHZESXFG0tZbj1M=";
}
.${system} or throwSystem;
};
in
{
x86_64-linux = firefox-linux;
aarch64-linux = firefox-linux;
x86_64-darwin = firefox-darwin;
aarch64-darwin = firefox-darwin;
}
.${system} or throwSystem