about summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-02-02 08:51:02 -0800
committerFranck Cuny <franck@fcuny.net>2024-02-02 08:53:16 -0800
commit16545ae411aa886e94be0deaae79e07f39b9adfb (patch)
tree890d35ae99c9aa397d34baf4607853760f5098dd /home
parentrun CI commands in a nix shell (diff)
downloadworld-16545ae411aa886e94be0deaae79e07f39b9adfb.tar.gz
install firefox
The firefox packages for darwin are broken.
`bandithedoge/nixpkgs-firefox-darwin` provides an overlay to install
the package on darwin.

Add some specific configurations to make firefox work as I want out of
the box.

We also add NUR to install some firefox extensions (ublock, 1password).
Diffstat (limited to 'home')
-rw-r--r--home/darwin.nix1
-rw-r--r--home/dev.nix1
-rw-r--r--home/firefox.nix81
-rw-r--r--home/git.nix3
4 files changed, 85 insertions, 1 deletions
diff --git a/home/darwin.nix b/home/darwin.nix
index 17eecd0..defd381 100644
--- a/home/darwin.nix
+++ b/home/darwin.nix
@@ -4,6 +4,7 @@
 
   imports = [
     ./dev.nix
+    ./firefox.nix
     ./git.nix
     ./ssh.nix
     ./zsh.nix
diff --git a/home/dev.nix b/home/dev.nix
index 16227ad..0c35380 100644
--- a/home/dev.nix
+++ b/home/dev.nix
@@ -30,7 +30,6 @@ in
     pythonEnv
 
     google-cloud-sdk
-
   ];
 
   home.sessionPath = [
diff --git a/home/firefox.nix b/home/firefox.nix
new file mode 100644
index 0000000..2710f91
--- /dev/null
+++ b/home/firefox.nix
@@ -0,0 +1,81 @@
+{ pkgs, ... }: {
+  programs.firefox = {
+    enable = true;
+    package = pkgs.firefox-bin;
+    profiles.default = {
+      isDefault = true;
+      extensions = with pkgs.nur.repos.rycee.firefox-addons; [
+        ublock-origin
+        onepassword-password-manager
+      ];
+      bookmarks = [
+        {
+          name = "GitHub Notifications";
+          keyword = "n";
+          url = "https://github.com/notifications?query=is%3Aunread";
+        }
+        {
+          name = "GitHub Pull Requests";
+          keyword = "p";
+          url = "https://github.com/pulls";
+        }
+      ];
+      search = {
+        default = "DuckDuckGo";
+        engines = {
+          "Nix Packages" = {
+            urls = [
+              {
+                template = "https://search.nixos.org/packages";
+                params = [
+                  {
+                    name = "type";
+                    value = "packages";
+                  }
+                  {
+                    name = "query";
+                    value = "{searchTerms}";
+                  }
+                ];
+              }
+            ];
+            icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+            definedAliases = [ "np" ];
+          };
+          "Google".metaData.hidden = true;
+          "Amazon.com".metaData.hidden = true;
+          "Bing".metaData.hidden = true;
+          "DuckDuckGo".metaData.hidden = true;
+          "eBay".metaData.hidden = true;
+          "Wikipedia (en)".metaData.alias = "w";
+        };
+        force = true;
+      };
+      settings = {
+        "app.update.auto" = false;
+
+        "browser.shell.checkDefaultBrowser" = false;
+        "browser.contentblocking.category" = "strict";
+        "browser.newtabpage.enabled" = false; # Make new tabs blank
+        "browser.startup.page" = 3; # Restore previous windows and tabs on startup.
+        "browser.warnOnQuit" = false;
+
+        "dom.forms.autocomplete.formautofill" = false; # Disable autofill
+
+        "extensions.formautofill.creditCards.enabled" = false; # Disable credit cards
+        "extensions.htmlaboutaddons.inline-options.enabled" = false;
+        "extensions.htmlaboutaddons.recommendations.enabled" = false;
+        "extensions.pocket.enabled" = false;
+        "extensions.pocket.showHome" = false;
+
+        # Disable Sponsored Top Sites
+        "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false;
+
+        "network.http.referer.spoofSource" = true;
+
+        "privacy.donottrackheader.value" = 1;
+        "privacy.donottrackheader.enabled" = true;
+      };
+    };
+  };
+}
diff --git a/home/git.nix b/home/git.nix
index 2c69c64..4fbbbb9 100644
--- a/home/git.nix
+++ b/home/git.nix
@@ -33,6 +33,9 @@ in
       # abort if the remote branch does not match the local one
       push.default = "simple";
 
+      # https://adamj.eu/tech/2024/01/18/git-improve-diff-histogram/
+      diff.algorithm = "histogram";
+
       init.defaultBranch = "main";
 
       pull.rebase = true;