Chromium: Difference between revisions
imported>Fadenb Created page with "'''Note''': Firefox requires the Google Hangouts Video plugin but Chromium (37+) doesn't require any plugin to use Google Hangouts. == Per User == It is possible to configur..." |
Add a workaround to make Chromium work with custom system-wide memory allocator. |
||
(29 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
== Installation == | |||
=== NixOS === | |||
Add {{nixos:package|chromium}} to {{NixOS Manual|name=systemPackages|anchor=#sec-package-management}}. | |||
== | == Accelerated video playback == | ||
Make sure [[Accelerated Video Playback]] is setup on the system properly. Check {{ic|chrome://gpu}} to see if Chromium has enabled hardware acceleration. | |||
If accelerated video playback is not working, check relevant flags at {{ic|chrome://flags}}, or enable them using the cli: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ | |||
environment.systemPackages = with pkgs; [ | |||
(chromium.override { | |||
commandLineArgs = [ | |||
"--enable-features=AcceleratedVideoEncoder" | |||
"--ignore-gpu-blocklist" | |||
"--enable-zero-copy" | |||
]; | |||
}) | |||
]; | |||
} | |||
</nowiki>}} | |||
In some cases, {{ic|chrome://gpu}} will show Video Decode as enabled, but Video Acceleration Information as blank, with {{ic|chrome://media-internals}} using FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features: | |||
< | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
{ | { | ||
environment.systemPackages = with pkgs; [ | |||
(chromium.override { | |||
commandLineArgs = [ | |||
"--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE" | |||
"--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport" | |||
"--enable-features=UseMultiPlaneFormatForHardwareVideo" | |||
"--ignore-gpu-blocklist" | |||
"--enable-zero-copy" | |||
]; | |||
}) | |||
]; | |||
} | |||
</nowiki>}} | |||
== Enabling native Wayland support == | |||
You can turn on native Wayland support in all chrome and most electron apps by setting an environment variable: <code>environment.sessionVariables.NIXOS_OZONE_WL = "1"</code>. | |||
== Enabling DRM (Widevine support) == | |||
By default, {{nixos:package|chromium}} does not support playing DRM protected media. However, there is a build time flag to include the unfree Widevine blob from nixpkgs: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ | |||
environment.systemPackages = with pkgs; [ | |||
(chromium.override { enableWideVine = true; }) | |||
]; | |||
} | } | ||
</ | </nowiki>}} | ||
== KeePassXC support in Flatpak == | |||
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:<syntaxhighlight lang="toml"># NativeMessagingHost directory (browser-specific) | |||
# Brave Browser | |||
xdg-config/BraveSoftware/Brave-Browser/NativeMessagingHosts:ro | |||
# Chromium | |||
xdg-config/chromium/NativeMessagingHosts:ro | |||
# Google Chrome | |||
xdg-config/google-chrome/NativeMessagingHosts:ro | |||
# KeePassXC server socket and Nix store | |||
xdg-run/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer | |||
/nix/store:ro</syntaxhighlight> | |||
< | |||
== Using libc memory allocator == | |||
Chromium may not work when an alternative system-wide memory allocator like scudo is used. To use libc on Chromium, the following firejail wrap is required:<syntaxhighlight lang="nix"> | |||
programs.firejail = { | |||
enable = true; | |||
wrappedBinaries = { | |||
chromium = { | chromium = { | ||
executable = "${pkgs.chromium}/bin/chromium-browser"; | |||
profile = "${pkgs.firejail}/etc/firejail/chromium-browser.profile"; | |||
extraArgs = [ | |||
"--blacklist=/etc/ld-nix.so.preload" | |||
]; | |||
}; | }; | ||
}; | }; | ||
}; | |||
</syntaxhighlight> | |||
[[Category:Applications]] | |||
</ | [[Category:Web Browser]] | ||
[[Category: |
Latest revision as of 21:40, 8 April 2025
Installation
NixOS
Add chromium
to
systemPackages.
Accelerated video playback
Make sure Accelerated Video Playback is setup on the system properly. Check chrome://gpu
to see if Chromium has enabled hardware acceleration.
If accelerated video playback is not working, check relevant flags at chrome://flags
, or enable them using the cli:

/etc/nixos/configuration.nix
{
environment.systemPackages = with pkgs; [
(chromium.override {
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder"
"--ignore-gpu-blocklist"
"--enable-zero-copy"
];
})
];
}
In some cases, chrome://gpu
will show Video Decode as enabled, but Video Acceleration Information as blank, with chrome://media-internals
using FFmpeg Video Decoder (software decoding). If this happens, try to enable the following features:

/etc/nixos/configuration.nix
{
environment.systemPackages = with pkgs; [
(chromium.override {
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder,VaapiOnNvidiaGPUs,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE"
"--enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport"
"--enable-features=UseMultiPlaneFormatForHardwareVideo"
"--ignore-gpu-blocklist"
"--enable-zero-copy"
];
})
];
}
Enabling native Wayland support
You can turn on native Wayland support in all chrome and most electron apps by setting an environment variable: environment.sessionVariables.NIXOS_OZONE_WL = "1"
.
Enabling DRM (Widevine support)
By default, chromium
does not support playing DRM protected media. However, there is a build time flag to include the unfree Widevine blob from nixpkgs:

/etc/nixos/configuration.nix
{
environment.systemPackages = with pkgs; [
(chromium.override { enableWideVine = true; })
];
}
KeePassXC support in Flatpak
To enable browser integration between KeePassXC and Chromium-based browsers when running in Flatpak, configure the following filesystem access:
# NativeMessagingHost directory (browser-specific)
# Brave Browser
xdg-config/BraveSoftware/Brave-Browser/NativeMessagingHosts:ro
# Chromium
xdg-config/chromium/NativeMessagingHosts:ro
# Google Chrome
xdg-config/google-chrome/NativeMessagingHosts:ro
# KeePassXC server socket and Nix store
xdg-run/app/org.keepassxc.KeePassXC/org.keepassxc.KeePassXC.BrowserServer
/nix/store:ro
Using libc memory allocator
Chromium may not work when an alternative system-wide memory allocator like scudo is used. To use libc on Chromium, the following firejail wrap is required:
programs.firejail = {
enable = true;
wrappedBinaries = {
chromium = {
executable = "${pkgs.chromium}/bin/chromium-browser";
profile = "${pkgs.firejail}/etc/firejail/chromium-browser.profile";
extraArgs = [
"--blacklist=/etc/ld-nix.so.preload"
];
};
};
};