summaryrefslogtreecommitdiff
path: root/modules/home/chrome.nix
blob: 976a74b3a2cd083e3f34c4bcca025af62779dfdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ pkgs, lib, ... }: {
	programs.chromium = {
		enable = true;
		package = pkgs.ungoogled-chromium;
	};
	programs.chromium.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:1i0668xhq5iflb4fn0ghwp79iz6mwspgxdqwp6incbvsyzr596kg";
				version = "1.61.0";
			})
		];
}