Firefox widevine

This commit is contained in:
Aleksandr Lebedev 2025-02-15 15:20:38 +01:00
parent df42ce284a
commit fb0b5d1a11
5 changed files with 64 additions and 1 deletions

17
flake.lock generated
View file

@ -679,6 +679,22 @@
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
}
},
"nixpkgs-master": {
"locked": {
"lastModified": 1739621138,
"narHash": "sha256-KtayqdyDOiGmgLy44FRsGewgjxC4S6CYePM5SKO3BaY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1e2268e58c8e74134dde16a45f40e4c32a934cb7",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1738843498,
@ -2975,6 +2991,7 @@
"nix-on-droid": "nix-on-droid",
"nixos-facter-modules": "nixos-facter-modules",
"nixpkgs": "nixpkgs_6",
"nixpkgs-master": "nixpkgs-master",
"sops-nix": "sops-nix",
"stylix": "stylix"
}

View file

@ -16,6 +16,9 @@
nixpkgs = {
url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
nixpkgs-master = {
url = "github:nixos/nixpkgs?ref=master";
};
neovim = {
url = "github:kylekrein/neovim";
inputs.nixpkgs.follows = "nixpkgs";

View file

@ -1,9 +1,21 @@
{
pkgs,
lib,
inputs,
...
}: let
pkgs-master = import inputs.nixpkgs-master {
inherit (pkgs) system;
config.allowUnfree = true;
};
in {
nixpkgs = {
overlays = [
(self: super: {
widevine-cdm = pkgs-master.widevine-cdm;
})
];
};
#nixpkgs.overlays = [
# (import ./widevine-overlay.nix)
#];
@ -11,6 +23,17 @@ in {
imports = [
#./apple-silicon-support
];
programs.firefox.policies.Preferences = {
"media.gmp-widevinecdm.version" = "system-installed";
"media.gmp-widevinecdm.visible" = true;
"media.gmp-widevinecdm.enabled" = true;
"media.gmp-widevinecdm.autoupdate" = false;
"media.eme.enabled" = true;
"media.eme.encrypted-media-encryption-scheme.enabled" = true;
};
programs.firefox.autoConfig = ''
// Zhu
lockPref("general.useragent.override","Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36");''; #doesn't work. You need to manually add this to about:config
hardware.asahi = {
peripheralFirmwareDirectory = ./firmware;
useExperimentalGPUDriver = true; #deprecated

View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
nixpkgs = {
overlays = [
(final: prev: {
firefox = prev.firefox.overrideAttrs (old: {
buildCommand =
old.buildCommand
+ ''
mkdir -p $out/gmp-widevinecdm/system-installed
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/_platform_specific/linux_arm64/libwidevinecdm.so" $out/gmp-widevinecdm/system-installed/libwidevinecdm.so
ln -s "${pkgs.widevine-cdm}/share/google/chrome/WidevineCdm/manifest.json" $out/gmp-widevinecdm/system-installed/manifest.json
wrapProgram "$oldExe" \
--set MOZ_GMP_PATH "$out/gmp-widevinecdm/system-installed"
'';
});
})];
};
}

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ lib, config, pkgs, hwconfig, ... }:
let
lock-false = {
@ -11,6 +11,7 @@
};
in
{
imports = [] ++ lib.optional (hwconfig.system == "aarch64-linux") ./aarch64-linux.nix;
programs = {
firefox = {
enable = true;