Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 1 | { lib, config, ... }: |
| 2 | { |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 3 | 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 Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 16 | 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 Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 23 | description = "Extra extensions to add to chromium on launch"; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 24 | default = [ ]; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 25 | }; |
| 26 | }; |
| 27 | config = lib.mkIf config.chimera.browser.chromium.enable ({ |
| 28 | programs.chromium = { |
| 29 | enable = true; |
| 30 | extensions = |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 31 | ( |
| 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 Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 67 | ++ config.chimera.browser.chromium.extraExtensions; |
| 68 | }; |
| 69 | }); |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 70 | } |