mirror of
https://github.com/elwrcl/heliux.git
synced 2026-10-31 06:38:02 +03:00
drm
This commit is contained in:
3 files changed
+55
-6
No files matched your search
@@ -25,20 +25,41 @@ nix run github:elwrcl/heliux
|
||||
|
||||
## DRM / Widevine
|
||||
|
||||
Helium is compiled with ***Widevine*** support, but upstream ships no CDM library and
|
||||
the wrapper passes `--disable-component-update`, so the component updater can
|
||||
Helium is compiled with ***Widevine*** support but upstream ships no CDM library,
|
||||
and the wrapper passes `--disable-component-update`, so the component updater can
|
||||
never fetch one at runtime. The result is that DRM playback silently fails.
|
||||
|
||||
The `helium-widevine` package bundles the CDM next to the binary, which fixes
|
||||
playback without re-enabling the update machinery:
|
||||
Supplying the CDM takes two steps, and the second one is easy to miss. Helium is
|
||||
built with `enable_widevine` but *without* `bundle_widevine_cdm`, so it never
|
||||
looks beside its own binary for a CDM — dropping the library into the package is
|
||||
not enough by itself. The only location it consults at startup is the hint file
|
||||
the component updater would normally leave in the user data dir:
|
||||
|
||||
```
|
||||
~/.config/net.imput.helium/WidevineCdm/latest-component-updated-widevine-cdm
|
||||
```
|
||||
|
||||
So `helium-widevine` pins the CDM in the store, and the home-manager module
|
||||
writes that hint file pointing at it. The update machinery stays off — the hint
|
||||
file is read directly at startup and does not depend on the updater:
|
||||
|
||||
```nix
|
||||
programs.helium.package = helium.packages.${system}.helium-widevine;
|
||||
```
|
||||
|
||||
Switching the package back to plain `helium` removes the hint file again, but
|
||||
only when it points into the Nix store; a hint left by a real component update
|
||||
is not touched.
|
||||
|
||||
The CDM is proprietary, so this output requires `allowUnfree`. Plain `helium` is
|
||||
unchanged and stays free-software only.
|
||||
|
||||
> [!NOTE]
|
||||
> The hint file is written by the home-manager module, so `helium-widevine` on
|
||||
> its own — installed with `nix profile` or `environment.systemPackages` — still
|
||||
> will not play DRM. Check with `helium://components`, or from the console:
|
||||
> `navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{initDataTypes:['cenc'],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'}]}])`
|
||||
|
||||
## NixOS + home-manager
|
||||
|
||||
> [!IMPORTANT]
|
||||
|
||||
@@ -100,6 +100,14 @@ let
|
||||
ExtensionInstallForcelist = map (ext: "${ext.id};${webStoreUpdateUrl}") cfg.extensions;
|
||||
}
|
||||
// cfg.extraPolicies;
|
||||
userDataDir = "${config.xdg.configHome}/net.imput.helium";
|
||||
widevineCdm =
|
||||
let
|
||||
subdir = cfg.package.widevineCdmSubdir or null;
|
||||
in
|
||||
if subdir == null then null else "${cfg.package}/${subdir}";
|
||||
|
||||
widevineHintFile = "${userDataDir}/WidevineCdm/latest-component-updated-widevine-cdm";
|
||||
|
||||
extensionRoot = "${config.xdg.dataHome}/helium/extensions";
|
||||
loadExtensionFlag =
|
||||
@@ -317,9 +325,25 @@ in
|
||||
''
|
||||
);
|
||||
|
||||
heliumWidevine = lib.hm.dag.entryAfter [ "writeBoundary" ] (
|
||||
if widevineCdm != null then
|
||||
''
|
||||
run ${lib.getExe' pkgs.coreutils "install"} -Dm644 \
|
||||
${pkgs.writeText "helium-widevine-cdm-hint" (builtins.toJSON { Path = widevineCdm; })} \
|
||||
${lib.escapeShellArg widevineHintFile}
|
||||
''
|
||||
else
|
||||
''
|
||||
if [ -f ${lib.escapeShellArg widevineHintFile} ] \
|
||||
&& grep -q '"/nix/store/' ${lib.escapeShellArg widevineHintFile}; then
|
||||
run rm -f ${lib.escapeShellArg widevineHintFile}
|
||||
fi
|
||||
''
|
||||
);
|
||||
|
||||
heliumPreferences = lib.mkIf (cfg.preferences != { }) (
|
||||
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
prefs_file="$HOME/.config/net.imput.helium/Default/Preferences"
|
||||
prefs_file=${lib.escapeShellArg "${userDataDir}/Default/Preferences"}
|
||||
nix_prefs=${lib.escapeShellArg (builtins.toJSON cfg.preferences)}
|
||||
merged_prefs="$(mktemp)"
|
||||
|
||||
|
||||
+5
-1
@@ -220,7 +220,11 @@ stdenv.mkDerivation {
|
||||
})
|
||||
];
|
||||
|
||||
passthru = { inherit enabledFeatures; };
|
||||
passthru = {
|
||||
inherit enabledFeatures;
|
||||
widevineCdmSubdir = if enableWidevine then "opt/helium/WidevineCdm" else null;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Private, fast, and honest web browser based on ungoogled-chromium";
|
||||
homepage = "https://helium.computer/";
|
||||
|
||||
Reference in new issue
Block a user