working build of chromium

This commit is contained in:
Wyatt J. Miller 2025-03-08 20:37:03 -05:00
parent dc95eb510f
commit cf6aab2897

View File

@ -2,57 +2,37 @@
pkgs, pkgs,
lib, 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 {
programs.firefox = { programs.firefox = {
enable = pkgs.stdenv.isLinux; # please see Mozilla's TOU and privacy policy please i implore you
enable = false;
}; };
programs.chromium = { programs.chromium = {
enable = pkgs.stdenv.isLinux; enable = pkgs.stdenv.isLinux;
package = package; package = pkgs.ungoogled-chromium;
enableWidevine = true; extensions = let
inherit extensions; createChromiumExtensionFor = browserVersion: {
id,
extraOpts = { sha256,
ExtensionSettings = builtins.listToAttrs (map version,
(extension: { }: {
name = extension.id; inherit id;
value = { crxPath = builtins.fetchurl {
installation_mode = "force_installed"; url = "https://clients2.google.com/service/update2/crx?response=redirect&acceptformat=crx2,crx3&prodversion=${browserVersion}&x=id%3D${id}%26installsource%3Dondemand%26uc";
update_url = "https://clients2.google.com/service/update2/crx"; name = "${id}.crx";
}; inherit sha256;
}) };
extensions); inherit version;
}; };
createChromiumExtension = createChromiumExtensionFor (lib.versions.major pkgs.ungoogled-chromium.version);
in [
(createChromiumExtension {
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
sha256 = "sha256:0ycnkna72n969crgxfy2lc1qbndjqrj46b9gr5l9b7pgfxi5q0ll";
version = "1.62.0";
})
];
}; };
} }