nix-config-v2/home/browser.nix

47 lines
1.5 KiB
Nix

{
pkgs,
lib,
...
}: {
programs.firefox = {
# please see Mozilla's TOU and privacy policy please i implore you
enable = false;
};
programs.chromium = {
enable = pkgs.stdenv.isLinux;
package = pkgs.ungoogled-chromium.override {
enableWideVine = true;
commandLineArgs = [
"--enable-features=AcceleratedVideoEncoder,VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo"
"--ignore-gpu-blocklist"
"--force-dark-mode"
"--enable-zero-copy"
];
};
extensions = let
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 pkgs.ungoogled-chromium.version);
in [
(createChromiumExtension {
# ublock origin
id = "cjpalhdlnbpafiamejdnhcphjbkeiagm";
sha256 = "sha256:0ycnkna72n969crgxfy2lc1qbndjqrj46b9gr5l9b7pgfxi5q0ll";
version = "1.62.0";
})
];
};
}