1{
2 config,
3 lib,
4 self,
5 pkgs,
6 ...
7}:
8let
9
10 inherit (lib)
11 mkIf
12 genAttrs
13 ;
14
15 inherit (builtins)
16 fromJSON
17 readFile
18 fetchurl
19 ;
20
21 inherit (lib.types) bool;
22
23 inherit (self.lib.modules) mkOpt;
24
25 cfg = config.sylveon.programs.librewolf;
26in
27{
28
29 options.sylveon.programs.librewolf = {
30 enable = mkOpt bool false "Enable webbrowser based on firefox";
31 };
32
33 config = mkIf cfg.enable {
34 programs.librewolf = {
35 enable = true;
36
37 languagePacks = [ "en-GB" "de" ];
38
39 settings = {
40 "browser.fullscreen.autohide" = false;
41
42 "webgl.disabled" = false;
43 "privacy.fingerprintingProtection" = false;
44 "browser.translations.enable" = false;
45
46 "media.ffmpeg.vaapi.enabled" = true;
47 "media.rdd-ffmpeg.enabled" = true;
48
49 "extensions.abuseReport.enabled" = false;
50 "extensions.formautofill.creditCards.enabled" = false;
51 "browser.contentblocking.report.lockwise.enabled" = false;
52
53 "identity.fxaccounts.enabled" = false;
54 "identity.fxaccounts.toolbar.enabled" = false;
55 "identity.fxaccounts.pairing.enabled" = false;
56 "identity.fxaccounts.commands.enabled" = false;
57 "privacy.clearOnShutdown.history" = false;
58 "privacy.clearOnShutdown.cookies" = false;
59 "network.cookie.lifetimePolicy" = 0;
60
61 # disable notifications
62 "dom.push.enabled" = false;
63 "dom.push.connection.enabled" = false;
64 "dom.battery.enabled" = false;
65 };
66
67 policies = {
68 DisplayBookmarksToolbar = "never";
69 DisableFirefoxAccounts = true;
70 DisableFeedbackCommands = true;
71
72 ExtensionSettings =
73 genAttrs
74 [
75 "uBlock0@raymondhill.net"
76 "sponsorBlocker@ajay.app"
77 "FirefoxColor@mozilla.com"
78 "firefox-enpass@enpass.io"
79 "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}" # Stylus
80 "{446900e4-71c2-419f-a6a7-df9c091e268b}" # Bitwarden
81 ]
82 (ext: {
83 installation_mode = "force_installed";
84 install_url = "https://addons.mozilla.org/firefox/downloads/latest/${ext}/latest.xpi";
85 });
86 };
87
88 profiles.default = {
89 extensions = {
90 force = true; # Needed for catppuccin
91
92 settings = {
93 # stylus themes need to be manually imported from now
94 # please create and import a new style file from here: https://catppuccin-userstyles-customizer.uncenter.dev/
95 "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}".settings = {
96 dbInChromeStorage = true; # required for Stylus
97 };
98 };
99 };
100
101 settings = {
102 # Default page should be my homepage
103 "browser.startup.homepage" = "https://xaiya.dev";
104 };
105
106 search = {
107 force = true;
108 default = "ddg";
109
110 engines = {
111 MyNixOS = {
112 name = "MyNixOS";
113 urls = [{
114 template = "https://mynixos.com/search";
115 params = [ { name = "q"; value = "{searchTerms}"; } ];
116 }];
117
118 icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake-white.svg";
119 definedAliases = [ "@n" ];
120 };
121
122 google.metaData.alias = "@g";
123 };
124 };
125 };
126 };
127
128 catppuccin.librewolf = {
129 force = true;
130 profiles.default.force = true;
131 };
132 };
133}