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.firefox = { |
| 4 | enable = lib.mkEnableOption "Use firefox 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 | adnauseam.enable = lib.mkEnableOption "Turn on AdNauseam ad blocker"; |
| 15 | }; |
| 16 | extraExtensions = lib.mkOption { |
| 17 | type = lib.types.listOf lib.types.package; |
| 18 | description = "Extra extensions to add to firefox"; |
Skyler Grey | 255115c | 2024-04-20 21:46:37 +0000 | [diff] [blame] | 19 | default = [ ]; |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 20 | }; |
| 21 | }; |
| 22 | config = lib.mkIf config.chimera.browser.firefox.enable ({ |
| 23 | programs.firefox = { |
| 24 | enable = true; |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 25 | profiles.chimera.extensions = |
| 26 | ( |
| 27 | if config.chimera.browser.firefox.extensions.bitwarden.enable then |
| 28 | [ config.nur.repos.rycee.firefox-addons.bitwarden ] |
| 29 | else |
| 30 | [ ] |
| 31 | ) |
| 32 | ++ ( |
| 33 | if config.chimera.browser.firefox.extensions.youtube.sponsorBlock.enable then |
| 34 | [ config.nur.repos.rycee.firefox-addons.sponsorblock ] |
| 35 | else |
| 36 | [ ] |
| 37 | ) |
| 38 | ++ ( |
| 39 | if config.chimera.browser.firefox.extensions.youtube.returnDislike.enable then |
| 40 | [ config.nur.repos.rycee.firefox-addons.return-youtube-dislikes ] |
| 41 | else |
| 42 | [ ] |
| 43 | ) |
| 44 | ++ ( |
| 45 | if config.chimera.browser.firefox.extensions.youtube.deArrow.enable then |
| 46 | [ config.nur.repos.rycee.firefox-addons.dearrow ] |
| 47 | else |
| 48 | [ ] |
| 49 | ) |
| 50 | ++ ( |
| 51 | if config.chimera.browser.firefox.extensions.reactDevTools.enable then |
| 52 | [ config.nur.repos.rycee.firefox-addons.react-devtools ] |
| 53 | else |
| 54 | [ ] |
| 55 | ) |
| 56 | ++ ( |
| 57 | if config.chimera.browser.firefox.extensions.ublockOrigin.enable then |
| 58 | [ config.nur.repos.rycee.firefox-addons.ublock-origin ] |
| 59 | else |
| 60 | [ ] |
| 61 | ) |
| 62 | ++ ( |
| 63 | if config.chimera.browser.firefox.extensions.adnauseam.enable then |
| 64 | [ config.nur.repos.rycee.firefox-addons.adnauseam ] |
| 65 | else |
| 66 | [ ] |
| 67 | ) |
Skyler Grey | 4e23089 | 2024-02-13 22:58:46 +0000 | [diff] [blame] | 68 | ++ config.chimera.browser.firefox.extraExtensions; |
| 69 | }; |
| 70 | }); |
Samuel Shuert | 02ffd1e | 2024-02-13 21:37:15 -0500 | [diff] [blame] | 71 | } |