Chromium: Difference between revisions

From NixOS Wiki
Add widevine docs
Klinger (talk | contribs)
mNo edit summary
Line 26: Line 26:
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>.
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 Widevine support ==
== 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:
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>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>

Revision as of 18:53, 10 May 2024

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=VaapiVideoDecodeLinuxGL"
        "--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; })
  ];
}