Created
May 3, 2022 02:54
-
-
Save thomashoneyman/8a5317850e91b7255ddf4fa9c4a383d2 to your computer and use it in GitHub Desktop.
chromium on mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs }: | |
if pkgs.stdenv.isLinux then | |
pkgs.chromium | |
else | |
let | |
wrapped = pkgs.writeShellScriptBin "chromium" '' | |
${chromium-mac}/Chromium.app/Contents/MacOS/Chromium $@ | |
''; | |
chromium-mac = final.stdenv.mkDerivation rec { | |
name = "chromium-mac"; | |
pname = "Chromium"; | |
build = "844399"; | |
# To update run: | |
# nix-prefetch-url --name 'chromium-mac.zip' https://playwright.azureedge.net/builds/chromium/${build}/chromium-mac.zip | |
src = let | |
builds = { | |
"844399" = { | |
sha256 = | |
"sha256-KiPsa4qUDAfjzWmm2CGX/HwwYGLDZP8xHX8JeBuNwHk="; | |
}; | |
}; | |
in final.fetchzip { | |
url = | |
"https://playwright.azureedge.net/builds/chromium/${build}/${name}.zip"; | |
sha256 = builds.${build}.sha256; | |
name = "${name}"; | |
}; | |
# The dmg contains the app and a symlink, the default unpackPhase tries to cd | |
# into the only directory produced so it fails. | |
sourceRoot = "."; | |
installPhase = '' | |
mkdir $out | |
mv chromium-mac/Chromium.app $out | |
''; | |
meta = with final.lib; { platforms = [ "x86_64-darwin" ]; }; | |
}; | |
in final.symlinkJoin { | |
name = "chromium-mac"; | |
paths = [ wrapped chromium-mac ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment