1# https://github.com/isabelroses/dotfiles/blob/ed6d3765ffb7dcfe67540f111f23d51a0d9617d5/modules/home/programs/chromium.nix#L16
2{
3 config,
4 lib,
5 pkgs,
6 ...
7}: let
8 inherit
9 (lib)
10 concatLists
11 enableFeature
12 ;
13in {
14 options.myHome.programs.helium.enable = lib.mkEnableOption "helium web browser";
15
16 config = lib.mkIf config.myHome.programs.helium.enable {
17 programs.helium = {
18 enable = true;
19
20 extensions = [
21 {id = "mdjildafknihdffpkfmmpnpoiajfjnjd";} # consent-o-matic
22 {id = "clngdbkpkpeebahjckkjfobafhncgmne";} # stylus
23 {id = "jinjaccalgkegednnccohejagnlnfdag";} # violentmonkey
24 {id = "nngceckbapebfimnlniiiahkandclblb";} # bitwarden
25 {id = "mnjggcdmjocbbbhaepdhchncahnbgone";} # sponsorblock
26 {id = "pncfbmialoiaghdehhbnbhkkgmjanfhe";} # ublacklist
27
28 rec {
29 id = "oladmjdebphlnjjcnomfhhbfdldiimaf"; # libredirect
30 version = "3.2.0";
31
32 crxPath = pkgs.fetchurl {
33 url = "https://github.com/libredirect/browser_extension/releases/download/v${version}/libredirect-${version}.crx";
34 sha256 = "sha256-Neja0pJ7rMV+riINeMcWxU2SzZ+ZETp6bV1MaYLHz1Y=";
35 };
36 }
37
38 rec {
39 id = "lkbebcjgcmobigpeffafkodonchffocl"; # bypass-paywalls-clean
40 version = "4.2.0.0";
41
42 crxPath = pkgs.fetchurl {
43 url = "https://gitflic.ru/project/magnolia1234/bpc_uploads/blob/raw?file=bypass-paywalls-chrome-clean-${version}.crx";
44 sha256 = "sha256-B++3RussuUv3AtDi2MnZH+SojCPOMnOXWW8GI3pI8lk=";
45 };
46 }
47 ];
48
49 package = pkgs.helium.override {
50 # https://github.com/secureblue/hardened-chromium
51 # https://github.com/secureblue/secureblue/blob/e500f078efc5748d5033a881bbbcdcd2de95a813/files/system/usr/etc/chromium/chromium.conf.md
52 commandLineArgs = concatLists [
53 # Aesthetics
54 [
55 "--gtk-version=4"
56 ]
57
58 # Wayland
59 [
60 "--ozone-platform=wayland"
61 "--enable-features=UseOzonePlatform"
62 ]
63
64 # Performance
65 [
66 (enableFeature true "gpu-rasterization")
67 (enableFeature true "oop-rasterization")
68 (enableFeature true "zero-copy")
69 "--ignore-gpu-blocklist"
70 ]
71
72 # Etc
73 [
74 "--disk-cache=$XDG_RUNTIME_DIR/helium-cache"
75 "--no-first-run"
76 "--disable-wake-on-wifi"
77 "--disable-breakpad"
78 "--no-default-browser-check"
79 "--enable-features=TouchpadOverscrollHistoryNavigation"
80 ]
81 ];
82 };
83 };
84 };
85}