2025-03-07 18:43:11 -05:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
package = pkgs.ungoogled-chromium;
|
|
|
|
createChromiumExtensionFor = browserVersion: {
|
|
|
|
id,
|
|
|
|
sha256,
|
|
|
|
version,
|
|
|
|
}: {
|
|
|
|
inherit id;
|
|
|
|
crxPath = builtins.fetchurl {
|
|
|
|
url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc";
|
|
|
|
name = "${id}.crx";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
inherit version;
|
|
|
|
};
|
|
|
|
createChromiumExtension = createChromiumExtensionFor (lib.versions.major package.version);
|
|
|
|
extensions = [
|
|
|
|
(createChromiumExtension {
|
|
|
|
# ublock origin
|
|
|
|
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
|
|
|
|
sha256 = "sha256-u81DNkZw/LBVyjk5nmrrJEVjdc+GFCay+rQZGpDH3jA=";
|
|
|
|
version = "1.37.2";
|
|
|
|
})
|
|
|
|
(createChromiumExtension {
|
|
|
|
# dark reader
|
|
|
|
id = "eimadpbcbfnmbkopoojfekhnkhdbieeh";
|
|
|
|
sha256 = "sha256-JcM2Ki3cTWdskFEFs2jk6LQUTFOojkBf+6HqO1GPK90=";
|
|
|
|
version = "4.9.34";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
in {
|
2024-09-08 16:44:14 -04:00
|
|
|
programs.firefox = {
|
|
|
|
enable = pkgs.stdenv.isLinux;
|
|
|
|
};
|
2025-03-07 18:43:11 -05:00
|
|
|
|
|
|
|
programs.chromium = {
|
|
|
|
enable = pkgs.stdenv.isLinux;
|
|
|
|
package = package;
|
|
|
|
enableWidevine = true;
|
|
|
|
inherit extensions;
|
|
|
|
|
|
|
|
extraOpts = {
|
|
|
|
ExtensionSettings = builtins.listToAttrs (map
|
|
|
|
(extension: {
|
|
|
|
name = extension.id;
|
|
|
|
value = {
|
|
|
|
installation_mode = "force_installed";
|
|
|
|
update_url = "https://clients2.google.com/service/update2/crx";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
extensions);
|
|
|
|
};
|
|
|
|
};
|
2024-09-08 16:44:14 -04:00
|
|
|
}
|