playwright-driver.browsers: expose raw fontconfig file

This commit is contained in:
Matthieu C. 2024-09-26 11:24:11 +02:00 committed by Matthieu Coudron
parent cc9debb422
commit 174479d040
2 changed files with 17 additions and 13 deletions

View File

@ -1,15 +1,10 @@
{
runCommand,
makeWrapper,
makeFontsConf,
fontconfig_file,
chromium,
...
}:
let
fontconfig = makeFontsConf {
fontDirectories = [ ];
};
in
runCommand "playwright-chromium"
{
nativeBuildInputs = [
@ -25,5 +20,5 @@ runCommand "playwright-chromium"
# as headless nixos test vms.
makeWrapper ${chromium}/bin/chromium $out/chrome-linux/chrome \
--set-default SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt \
--set-default FONTCONFIG_FILE ${fontconfig}
--set-default FONTCONFIG_FILE ${fontconfig_file}
''

View File

@ -217,12 +217,15 @@ let
meta.platforms = lib.platforms.darwin;
};
browsers-linux =
browsers-linux = lib.makeOverridable (
{
withChromium ? true,
withFirefox ? true,
withWebkit ? true,
withFfmpeg ? true,
fontconfig_file ? makeFontsConf {
fontDirectories = [ ];
},
}:
let
browsers =
@ -242,14 +245,20 @@ let
# TODO check platform for revisionOverrides
"${name}-${value.revision}"
(
callPackage ./${name}.nix {
inherit suffix system throwSystem;
inherit (value) revision;
}
callPackage ./${name}.nix (
{
inherit suffix system throwSystem;
inherit (value) revision;
}
// lib.optionalAttrs (name == "chromium") {
inherit fontconfig_file;
}
)
)
) browsers
)
);
)
);
in
{
playwright-core = playwright-core;