blob: c21f21cffbab6c66e8d1dd4a8b8bb8e0a82b17d6 [file] [log] [blame]
Samuel Shuert02ffd1e2024-02-13 21:37:15 -05001{ lib, config, ... }:
2{
Skyler Grey4e230892024-02-13 22:58:46 +00003 options.chimera.browser.chromium = {
4 enable = lib.mkEnableOption "Use chromium browser";
5 extensions = {
6 bitwarden.enable = lib.mkEnableOption "Turn on Bitwarden extension";
7 youtube = {
8 sponsorBlock.enable = lib.mkEnableOption "Turn on Sponsor Block";
9 returnDislike.enable = lib.mkEnableOption "Turn on Return Youtube Dislike";
10 deArrow.enable = lib.mkEnableOption "Turn on De Arrow";
11 };
12 reactDevTools.enable = lib.mkEnableOption "Turn on React Dev Tools";
13 ublockOrigin.enable = lib.mkEnableOption "Turn on uBlock Origin ad blocker";
14 };
15 extraExtensions = lib.mkOption {
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050016 type = lib.types.listOf (
17 lib.types.either { id = lib.types.str; } {
18 id = lib.types.str;
19 crxPath = lib.types.path;
20 version = lib.types.str;
21 }
22 );
Skyler Grey4e230892024-02-13 22:58:46 +000023 description = "Extra extensions to add to chromium on launch";
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050024 default = [ ];
Skyler Grey4e230892024-02-13 22:58:46 +000025 };
26 };
27 config = lib.mkIf config.chimera.browser.chromium.enable ({
28 programs.chromium = {
29 enable = true;
30 extensions =
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050031 (
32 if config.chimera.browser.chromium.extensions.bitwarden.enable then
33 [ { id = "nngceckbapebfimnlniiiahkandclblb"; } ]
34 else
35 [ ]
36 ) # Bitwarden
37 ++ (
38 if config.chimera.browser.chromium.extensions.youtube.sponsorBlock.enable then
39 [ { id = "mnjggcdmjocbbbhaepdhchncahnbgone"; } ]
40 else
41 [ ]
42 ) # Sponsor Block
43 ++ (
44 if config.chimera.browser.chromium.extensions.youtube.returnDislike.enable then
45 [ { id = "gebbhagfogifgggkldgodflihgfeippi"; } ]
46 else
47 [ ]
48 ) # Return youtube dislike
49 ++ (
50 if config.chimera.browser.chromium.extensions.youtube.deArrow.enable then
51 [ { id = "enamippconapkdmgfgjchkhakpfinmaj"; } ]
52 else
53 [ ]
54 ) # DeArrow
55 ++ (
56 if config.chimera.browser.chromium.extensions.reactDevTools.enable then
57 [ { id = "fmkadmapgofadopljbjfkapdkoienihi"; } ]
58 else
59 [ ]
60 ) # React Dev Tools
61 ++ (
62 if config.chimera.browser.chromium.extensions.ublockOrigin.enable then
63 [ { id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } ]
64 else
65 [ ]
66 ) # uBlock Origin
Skyler Grey4e230892024-02-13 22:58:46 +000067 ++ config.chimera.browser.chromium.extraExtensions;
68 };
69 });
Samuel Shuert02ffd1e2024-02-13 21:37:15 -050070}