[Browser] greatly improve Video Download Helper support

Add this extension to Chromium too, using Edge version (not limited by Google policy)
This commit is contained in:
Antoine Viallon 2023-05-05 11:47:27 +02:00
parent 539e85ed95
commit 8412fb3dec
Signed by: aviallon
GPG key ID: 186FC35EDEB25716
2 changed files with 25 additions and 6 deletions

View file

@ -3,6 +3,7 @@ with lib;
let let
cfg = config.aviallon.desktop; cfg = config.aviallon.desktop;
generalCfg = config.aviallon.general; generalCfg = config.aviallon.general;
vdhcoapp = pkgs.nur.repos.wolfangaukang.vdhcoapp;
in { in {
options.aviallon.desktop.browser = { options.aviallon.desktop.browser = {
firefox.overrides = mkOption { firefox.overrides = mkOption {
@ -15,16 +16,34 @@ in {
}; };
config = mkIf (cfg.enable && !generalCfg.minimal) { config = mkIf (cfg.enable && !generalCfg.minimal) {
environment.systemPackages = with pkgs; [] environment.systemPackages = with pkgs; [
++ optionals (!generalCfg.minimal) [
chromium chromium
myFirefox # firefox is added by plasma or gnome
vdhcoapp
]; ];
aviallon.desktop.browser.firefox.overrides.extraNativeMessengingHosts = [
vdhcoapp
];
environment.etc = with builtins; let
vdhcoappManifestFile = unsafeDiscardStringContext (readFile "${vdhcoapp}/etc/chromium/native-messaging-hosts/net.downloadhelper.coapp.json");
vdhcoappManifest = fromJSON (toString vdhcoappManifestFile);
moddedManifest = toJSON (recursiveUpdate vdhcoappManifest {
allowed_origins = vdhcoappManifest.allowed_origins ++ [ "chrome-extension://jmkaglaafmhbcpleggkmaliipiilhldn/" ];
});
manifestFile = pkgs.writeText "${vdhcoappManifest.name}.json" moddedManifest;
in {
"chromium/native-messaging-hosts/net.downloadhelper.coapp.json".source =
"${manifestFile}";
};
programs.chromium = { programs.chromium = {
enable = true; enable = true;
# https://docs.microsoft.com/en-us/microsoft-edge/extensions-chromium/enterprise/auto-update # https://docs.microsoft.com/en-us/microsoft-edge/extensions-chromium/enterprise/auto-update
# https://clients2.google.com/service/update2/crx?x=id%3D{extension_id}%26v%3D{extension_version} # Chrome Web Store: https://clients2.google.com/service/update2/crx?x=id%3D{extension_id}%26v%3D{extension_version}
# Edge Web Store: https://edge.microsoft.com/extensionwebstorebase/v1/crx
extensions = [ extensions = [
# "gcbommkclmclpchllfjekcdonpmejbdp;https://clients2.google.com/service/update2/crx" # HTTPS Everywhere # "gcbommkclmclpchllfjekcdonpmejbdp;https://clients2.google.com/service/update2/crx" # HTTPS Everywhere
"mleijjdpceldbelpnpkddofmcmcaknm" # Smart HTTPS "mleijjdpceldbelpnpkddofmcmcaknm" # Smart HTTPS
@ -33,6 +52,8 @@ in {
"eimadpbcbfnmbkopoojfekhnkhdbieeh" # Dark Reader "eimadpbcbfnmbkopoojfekhnkhdbieeh" # Dark Reader
"lkbebcjgcmobigpeffafkodonchffocl;https://gitlab.com/magnolia1234/bypass-paywalls-chrome-clean/-/raw/master/updates.xml" # Bypass Paywalls "lkbebcjgcmobigpeffafkodonchffocl;https://gitlab.com/magnolia1234/bypass-paywalls-chrome-clean/-/raw/master/updates.xml" # Bypass Paywalls
"jmkaglaafmhbcpleggkmaliipiilhldn;https://edge.microsoft.com/extensionwebstorebase/v1/crx" # Video DownloadHelper (Edge)
]; ];
extraOpts = { extraOpts = {
"PlatformHEVCDecoderSupport" = true; "PlatformHEVCDecoderSupport" = true;

View file

@ -17,8 +17,6 @@ in {
jellyfin-media-player jellyfin-media-player
jamesdsp # Audio post-processing jamesdsp # Audio post-processing
nur.repos.wolfangaukang.vdhcoapp
]; ];