aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/conf/firefox/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hm/soispha/conf/firefox/default.nix')
-rw-r--r--hm/soispha/conf/firefox/default.nix71
1 files changed, 71 insertions, 0 deletions
diff --git a/hm/soispha/conf/firefox/default.nix b/hm/soispha/conf/firefox/default.nix
new file mode 100644
index 00000000..1040ed0b
--- /dev/null
+++ b/hm/soispha/conf/firefox/default.nix
@@ -0,0 +1,71 @@
+{
+ config,
+ pkgs,
+ lib,
+ user_js,
+ video_pause,
+ ...
+}: let
+ userChrome = builtins.readFile ./config/chrome/userChrome.css;
+
+ user_js_nix = (import ./config/prefs) {inherit pkgs lib config user_js;};
+
+ extensions = builtins.map buildFirefoxXpiAddon (
+ lib.attrValues (
+ lib.importJSON ./config/extensions/extensions.json
+ )
+ );
+ engines = (import ./config/search/engines) {inherit pkgs;};
+
+ # source: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/default.nix
+ buildFirefoxXpiAddon = (import ./functions/extensions) {inherit pkgs;};
+
+ video-pauser = (import ./functions/extensions/video-pauser.nix) {inherit pkgs video_pause;};
+in {
+ home.packages = [
+ pkgs.tridactyl-native
+ ];
+ home.sessionVariables = {
+ # improve touch input & make scrolling smother
+ MOZ_USE_XINPUT2 = "1";
+ # improve wayland support
+ MOZ_ENABLE_WAYLAND = 1;
+ };
+ xdg.mimeApps = {
+ enable = true;
+ defaultApplications = {
+ "text/html" = ["firefox.desktop"];
+ "x-scheme-handler/http" = ["firefox.desktop"];
+ "x-scheme-handler/https" = ["firefox.desktop"];
+ "x-scheme-handler/about" = ["firefox.desktop"];
+ "x-scheme-handler/unknown" = ["firefox.desktop"];
+ };
+ };
+ programs.firefox = {
+ enable = true;
+ package = pkgs.firefox-wayland.override {
+ extraNativeMessagingHosts = [video-pauser];
+ cfg = {
+ enableTridactylNative = true;
+ };
+ };
+ profiles."default" = {
+ inherit extensions;
+ isDefault = true;
+ id = 0;
+ name = "default";
+
+ inherit userChrome;
+
+ search = {
+ default = "Brave Search";
+ force = true;
+
+ inherit engines;
+ };
+
+ bookmarks = [];
+ extraConfig = builtins.readFile "${user_js_nix}/user.js";
+ };
+ };
+}