From c22260ba0fd673110f054deb486faf8371822b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sat, 22 Nov 2025 22:27:21 +0800 Subject: [PATCH 1/5] vanadium/connectivity: block linkedin --- nix/configurations/vanadium/nixos/connectivity.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nix/configurations/vanadium/nixos/connectivity.nix b/nix/configurations/vanadium/nixos/connectivity.nix index e2bf050a..2644cd27 100644 --- a/nix/configurations/vanadium/nixos/connectivity.nix +++ b/nix/configurations/vanadium/nixos/connectivity.nix @@ -61,11 +61,14 @@ # # This is the fascist one, just block it because I can't tell - nixos.wiki + 0.0.0.0 nixos.wiki # Gotta purify my smoos brain for a while 0.0.0.0 instagram.com 0.0.0.0 www.instagram.com + + 0.0.0.0 linkedin.com + 0.0.0.0 www.linkedin.com ''; }; From b0813c1e9699dc7f2d2311b0a2b8d1bd159be388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sat, 22 Nov 2025 22:27:21 +0800 Subject: [PATCH 2/5] vanadium/connectivity: block linkedin --- nix/configurations/vanadium/nixos/connectivity.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nix/configurations/vanadium/nixos/connectivity.nix b/nix/configurations/vanadium/nixos/connectivity.nix index e2bf050a..c484540f 100644 --- a/nix/configurations/vanadium/nixos/connectivity.nix +++ b/nix/configurations/vanadium/nixos/connectivity.nix @@ -61,11 +61,15 @@ # # This is the fascist one, just block it because I can't tell - nixos.wiki + 0.0.0.0 nixos.wiki # Gotta purify my smoos brain for a while 0.0.0.0 instagram.com 0.0.0.0 www.instagram.com + + # The "people who you viewed can see you" thing is weird af + 0.0.0.0 linkedin.com + 0.0.0.0 www.linkedin.com ''; }; From d74245aff7dbb5e3114d155c29df3358ecba1553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 23 Nov 2025 10:51:44 +0800 Subject: [PATCH 3/5] vanadium/zen-browser: init --- nix/configurations/vanadium.nix | 5 + .../vanadium/home/zen-browser.nix | 165 +++++++++++++++++ nix/homeModules/common/firefox.nix | 22 +-- nix/homeModules/common/zen-browser.nix | 169 ++++++++++++++++++ nix/overlays/zen-browser.nix | 15 ++ npins/sources.json | 13 ++ 6 files changed, 378 insertions(+), 11 deletions(-) create mode 100644 nix/configurations/vanadium/home/zen-browser.nix create mode 100644 nix/homeModules/common/zen-browser.nix create mode 100644 nix/overlays/zen-browser.nix diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index 80919604..7234fbdf 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -56,6 +56,7 @@ in ../overlays/eepy.nix ../overlays/calibre-no-mime.nix ../overlays/fcitx5-table-extra-taiwanese.nix + ../overlays/zen-browser.nix ../overlays/iosevka.nix ../packages/overlay.nix @@ -152,6 +153,7 @@ in ./vanadium/home/programs.nix ./vanadium/home/misc.nix + ./vanadium/home/zen-browser.nix ./vanadium/home/firefox.nix ./vanadium/home/xmobar.nix @@ -170,6 +172,7 @@ in ../homeModules/common/atuin.nix ../homeModules/common/direnv.nix ../homeModules/common/feh.nix + ../homeModules/common/zen-browser.nix ../homeModules/common/firefox.nix ../homeModules/common/fzf.nix ../homeModules/common/git.nix @@ -191,6 +194,8 @@ in # (sources.agenix + "/modules/age-home.nix") sources.wired-notify.asFlake.homeManagerModules.default + + sources.zen-browser.asFlake.homeModules.twilight ]; } diff --git a/nix/configurations/vanadium/home/zen-browser.nix b/nix/configurations/vanadium/home/zen-browser.nix new file mode 100644 index 00000000..beee8d6a --- /dev/null +++ b/nix/configurations/vanadium/home/zen-browser.nix @@ -0,0 +1,165 @@ +{ + pkgs, + config, + ... +}: +let + inherit (pkgs) nur; +in +{ + programs.zen-browser = { + enable = true; + + policies.SearchEngines.Add = [ + # Forges + { + Name = "GitHub"; + Alias = "@gh"; + IconURL = "https://github.com/favicon.ico"; + Description = "Your code yum yum"; + URLTemplate = "https://github.com/search?q={searchTerms}&type=repositories"; + } + { + Name = "GitHub (Code Search)"; + Alias = "@ghc"; + IconURL = "https://github.com/favicon.ico"; + Description = "Your code yum yum"; + URLTemplate = "https://github.com/search?q={searchTerms}&type=code"; + } + { + Name = "Codeberg"; + Alias = "@cb"; + IconURL = "https://codeberg.org/favicon.ico"; + Description = "Software development, but free!"; + URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}"; + } + { + Name = "?C"; + Alias = "@cc"; + IconURL = "https://git.confusedcompiler.org/favicon.ico"; + URLTemplate = "https://git.confusedcompiler.org/explore/repos?q={searchTerms}"; + } + + # Nix{,OS,pkgs} + { + Name = "NixOS Search (Package)"; + Alias = "@np"; + IconURL = "https://nixos.org/favicon.ico"; + Description = "Search in nixpkgs"; + URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; + } + { + Name = "NixOS Search (Options)"; + Alias = "@no"; + IconURL = "https://nixos.org/favicon.ico"; + Description = "Search in NixOS options"; + URLTemplate = "https://search.nixos.org/options?query={searchTerms}"; + } + + # Haskell + { + Name = "Flora"; + Alias = "@hs"; + IconURL = "https://flora.pm/static/icons/favicon-32x32.png"; + URLTemplate = "https://flora.pm/search?q={searchTerms}"; + } + + # Discourse + { + Name = "NixOS Discourse"; + Alias = "@nd"; + IconURL = "https://nixos.org/favicon.ico"; + URLTemplate = "https://discourse.nixos.org/search?q={searchTerms}"; + } + { + Name = "Framework Discourse"; + Alias = "@fd"; + IconURL = "https://frame.work/favicon.ico"; + URLTemplate = "https://community.frame.work/search?q={searchTerms}"; + } + + # Misc + { + Name = "YouTube"; + Alias = "@yt"; + IconURL = "https://youtube.com/favicon.ico"; + SuggestURLTemplate = "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt"; + URLTemplate = "https://www.youtube.com/results?search_query={searchTerms}"; + } + { + Name = "Genius"; + Alias = "@geni"; + IconURL = "https://genius.com/favicon.ico"; + URLTemplate = "https://genius.com/search?q={searchTerms}"; + } + ]; + + profiles = { + default = { + settings = { + # "full-screen-api.ignore-widgets" = true; # limit fullscreen mode to window + }; + userChrome = '' + /* monofont tweak */ + #statuspanel-label { + font-family: monospace; + } + .urlbar-input-box { + font-family: monospace; + } + ''; + extensions.packages = + let + addons = nur.repos.rycee.firefox-addons; + in + [ + addons.sponsorblock + addons.return-youtube-dislikes + addons.consent-o-matic + ]; + }; + + junk = { + id = 1; + inherit (config.programs.zen-browser.profiles.default) + settings + userChrome + ; + + extensions.packages = + let + addons = nur.repos.rycee.firefox-addons; + in + [ addons.multi-account-containers ]; + + containers = { + raisin = { + color = "purple"; + icon = "fruit"; + id = 1; + }; + pomme = { + color = "red"; + icon = "fruit"; + id = 2; + }; + }; + }; + + # Isolate it because it's proprietary + tampermonkey = { + id = 2; + inherit (config.programs.zen-browser.profiles.default) + settings + userChrome + ; + + extensions.packages = + let + addons = nur.repos.rycee.firefox-addons; + in + [ addons.tampermonkey ]; + }; + }; + }; +} diff --git a/nix/homeModules/common/firefox.nix b/nix/homeModules/common/firefox.nix index 556a528d..c5a1b96b 100644 --- a/nix/homeModules/common/firefox.nix +++ b/nix/homeModules/common/firefox.nix @@ -129,15 +129,15 @@ in }; }; - xdg.mimeApps = lib.mkIf cfg.enable { - enable = true; - # source: https://unix.stackexchange.com/a/684582 - 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"; - }; - }; + # xdg.mimeApps = lib.mkIf cfg.enable { + # enable = true; + # # source: https://unix.stackexchange.com/a/684582 + # 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"; + # }; + # }; } diff --git a/nix/homeModules/common/zen-browser.nix b/nix/homeModules/common/zen-browser.nix new file mode 100644 index 00000000..2f9e47cf --- /dev/null +++ b/nix/homeModules/common/zen-browser.nix @@ -0,0 +1,169 @@ +{ + pkgs, + config, + lib, + ... +}: +let + inherit (pkgs) nur; + + cfg = config.programs.zen-browser; +in +{ + programs.zen-browser = { + # TODO: upstream default is broken? They default to zen-twilight + package = pkgs.twilight; + + # https://mozilla.github.io/policy-templates + # The following have more complex logic, keep them as policies and not profiles + policies = { + RequestedLocales = [ + "fr-FR" # for fuck sake stop showing me translated version of French gov sites + "zh-TW" + "en-US" + ]; + + SearchEngines = { + Remove = [ + "Google" + "Bing" + "DuckDuckGo" + "Qwant" + "eBay" + "Perplexity" + ]; + Default = "Brave"; + Add = [ + { + Name = "Brave"; + Alias = "@br"; + URLTemplate = "https://search.brave.com/search?q={searchTerms}&source=web"; + SuggestURLTemplate = "https://suggestqueries.google.com/complete/search?q={searchTerms}"; + } + ]; + }; + NoDefaultBookmarks = true; + DisplayMenuBar = "never"; + DisplayBookmarksToolbar = "never"; + DNSOverHTTPS = { + Enabled = false; + }; + }; + + # https://searchfox.org/mozilla-central/source/browser/components/enterprisepolicies/Policies.sys.mjs + # Some policies can be rewritten to profiles configuration + # + # TODO: try out the "locked" semantic from zen + # https://github.com/0xc000022070/zen-browser-flake/tree/main#preferences + profiles.default = { + settings = { + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "browser.tabs.loadInBackground" = true; + "browser.ctrlTab.sortByRecentlyUsed" = false; + "layout.css.devPixelsPerPx" = 1.1; + + # open links in new window + # this works a lot better with xmonad where I have a bunch of windows + "browser.link.open_newwindow" = 2; + + # Sponsored crap + # Yes + "browser.newtabpage.activity-stream.showSearch" = true; + "browser.newtabpage.activity-stream.feeds.topsites" = true; + # No + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.newtabpage.activity-stream.feeds.section.highlights" = false; + "browser.newtabpage.activity-stream.feeds.system.topstories" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + + # URL + # Yes + "browser.urlbar.suggest.quicksuggest.nonsponsored" = true; + # No + "browser.urlbar.suggest.quicksuggest.sponsored" = false; + + # Pasword manager + "signon.rememberSignons" = false; + "services.passwordSavingEnabled" = false; + "pref.privacy.disable_button.view_passwords" = false; + + # Hardware acceleration + "layers.acceleration.disabled" = false; + + # Screenshot + "screenshots.browser.component.enabled" = true; + + # Recommendations + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; + "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; + "extensions.htmlaboutaddons.recommendations.enabled" = false; # Addons + + # Onboarding + "browser.aboutwelcome.enabled" = false; + + # AI crap + "browser.ml.chat.enabled" = false; + "browser.ml.chat.page" = false; + "browser.ml.chat.shortcuts" = false; + "browser.ml.chat.sidebar" = false; + + # Prevent WebRTC leak + # https://mullvad.net/en/help/webrtc + "media.peerconnection.enabled" = false; + }; + + extensions.packages = + let + addons = nur.repos.rycee.firefox-addons; + in + [ + addons.ublock-origin + addons.privacy-badger + addons.user-agent-string-switcher + + /* + Here's to you who want to remove news feed eradicator because you find it annoying: + It is here to annoy you so it is less likely for you to be on the agency inversion path. + DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT. + + If you think it's annoying, go do some jump rope, sing, live. + */ + addons.news-feed-eradicator # did you read the comment above? + addons.multi-account-containers + ]; + }; + }; + + xdg.mimeApps = + let + associations = builtins.listToAttrs ( + map + (name: { + inherit name; + value = cfg.package.meta.desktopFileName; + }) + [ + "application/x-extension-shtml" + "application/x-extension-xhtml" + "application/x-extension-html" + "application/x-extension-xht" + "application/x-extension-htm" + "x-scheme-handler/unknown" + "x-scheme-handler/mailto" + "x-scheme-handler/chrome" + "x-scheme-handler/about" + "x-scheme-handler/https" + "x-scheme-handler/http" + "application/xhtml+xml" + "application/json" + "text/plain" + "text/html" + ] + ); + in + lib.mkIf cfg.enable { + associations.added = associations; + defaultApplications = associations; + }; +} diff --git a/nix/overlays/zen-browser.nix b/nix/overlays/zen-browser.nix new file mode 100644 index 00000000..1afc5307 --- /dev/null +++ b/nix/overlays/zen-browser.nix @@ -0,0 +1,15 @@ +let + sources = import ../../npins; +in +final: _: { + inherit (sources.zen-browser.asFlake.packages.${final.system}) + beta-unwrapped + twilight-unwrapped + twilight-official-unwrapped + + beta # default + + twilight + twilight-official + ; +} diff --git a/npins/sources.json b/npins/sources.json index ae589196..5ea34392 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -368,6 +368,19 @@ "revision": "6a96aa2066d8ad945f2323b63dc217081ef51168", "url": "https://github.com/Toqozz/wired-notify/archive/6a96aa2066d8ad945f2323b63dc217081ef51168.tar.gz", "hash": "02b8pva12rzcciq5lavwk824xaym28igfsva4kikvd7mxs06ccwx" + }, + "zen-browser": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "0xc000022070", + "repo": "zen-browser-flake" + }, + "branch": "main", + "submodules": false, + "revision": "ef951ed2d976bcd1f57a09f358fdda9fa9425018", + "url": "https://github.com/0xc000022070/zen-browser-flake/archive/ef951ed2d976bcd1f57a09f358fdda9fa9425018.tar.gz", + "hash": "1s85cxiwhzwqgbazcgv12xqdlk1nkfynv23r9zj8gip4j6pznr4z" } }, "version": 5 From 7549b797302101de38b18df929a3bb98876313d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 23 Nov 2025 10:57:12 +0800 Subject: [PATCH 4/5] zen-browser: move package name oddity to overlay --- nix/homeModules/common/zen-browser.nix | 3 --- nix/overlays/zen-browser.nix | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/nix/homeModules/common/zen-browser.nix b/nix/homeModules/common/zen-browser.nix index 2f9e47cf..b490d95b 100644 --- a/nix/homeModules/common/zen-browser.nix +++ b/nix/homeModules/common/zen-browser.nix @@ -11,9 +11,6 @@ let in { programs.zen-browser = { - # TODO: upstream default is broken? They default to zen-twilight - package = pkgs.twilight; - # https://mozilla.github.io/policy-templates # The following have more complex logic, keep them as policies and not profiles policies = { diff --git a/nix/overlays/zen-browser.nix b/nix/overlays/zen-browser.nix index 1afc5307..f4ffa489 100644 --- a/nix/overlays/zen-browser.nix +++ b/nix/overlays/zen-browser.nix @@ -1,15 +1,19 @@ let sources = import ../../npins; in -final: _: { - inherit (sources.zen-browser.asFlake.packages.${final.system}) - beta-unwrapped - twilight-unwrapped - twilight-official-unwrapped +final: _: +let + zenpkgs = sources.zen-browser.asFlake.packages.${final.system}; +in +{ + # TODO: upstream default is broken? They default to zen-twilight + "zen-beta-unwrapped" = zenpkgs."beta-unwrapped"; + "zen-twilight-unwrapped" = zenpkgs."twilight-unwrapped"; + "zen-twilight-official-unwrapped" = zenpkgs."twilight-official-unwrapped"; - beta # default + # default + "zen-beta" = zenpkgs."beta"; - twilight - twilight-official - ; + "zen-twilight" = zenpkgs."twilight"; + "zen-twilight-official" = zenpkgs."twilight-official"; } From c2c655981af0fc900cf73fc5b4dcc8561e6fd836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 23 Nov 2025 11:05:57 +0800 Subject: [PATCH 5/5] Revert "vanadium/zen-browser: init" This reverts commit 87524f3b3d1a10f18797286af04ea700b6ea16a2. --- nix/configurations/vanadium.nix | 5 - .../vanadium/home/zen-browser.nix | 165 ----------------- nix/homeModules/common/firefox.nix | 22 +-- nix/homeModules/common/zen-browser.nix | 166 ------------------ nix/overlays/zen-browser.nix | 19 -- npins/sources.json | 13 -- 6 files changed, 11 insertions(+), 379 deletions(-) delete mode 100644 nix/configurations/vanadium/home/zen-browser.nix delete mode 100644 nix/homeModules/common/zen-browser.nix delete mode 100644 nix/overlays/zen-browser.nix diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index 7234fbdf..80919604 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -56,7 +56,6 @@ in ../overlays/eepy.nix ../overlays/calibre-no-mime.nix ../overlays/fcitx5-table-extra-taiwanese.nix - ../overlays/zen-browser.nix ../overlays/iosevka.nix ../packages/overlay.nix @@ -153,7 +152,6 @@ in ./vanadium/home/programs.nix ./vanadium/home/misc.nix - ./vanadium/home/zen-browser.nix ./vanadium/home/firefox.nix ./vanadium/home/xmobar.nix @@ -172,7 +170,6 @@ in ../homeModules/common/atuin.nix ../homeModules/common/direnv.nix ../homeModules/common/feh.nix - ../homeModules/common/zen-browser.nix ../homeModules/common/firefox.nix ../homeModules/common/fzf.nix ../homeModules/common/git.nix @@ -194,8 +191,6 @@ in # (sources.agenix + "/modules/age-home.nix") sources.wired-notify.asFlake.homeManagerModules.default - - sources.zen-browser.asFlake.homeModules.twilight ]; } diff --git a/nix/configurations/vanadium/home/zen-browser.nix b/nix/configurations/vanadium/home/zen-browser.nix deleted file mode 100644 index beee8d6a..00000000 --- a/nix/configurations/vanadium/home/zen-browser.nix +++ /dev/null @@ -1,165 +0,0 @@ -{ - pkgs, - config, - ... -}: -let - inherit (pkgs) nur; -in -{ - programs.zen-browser = { - enable = true; - - policies.SearchEngines.Add = [ - # Forges - { - Name = "GitHub"; - Alias = "@gh"; - IconURL = "https://github.com/favicon.ico"; - Description = "Your code yum yum"; - URLTemplate = "https://github.com/search?q={searchTerms}&type=repositories"; - } - { - Name = "GitHub (Code Search)"; - Alias = "@ghc"; - IconURL = "https://github.com/favicon.ico"; - Description = "Your code yum yum"; - URLTemplate = "https://github.com/search?q={searchTerms}&type=code"; - } - { - Name = "Codeberg"; - Alias = "@cb"; - IconURL = "https://codeberg.org/favicon.ico"; - Description = "Software development, but free!"; - URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}"; - } - { - Name = "?C"; - Alias = "@cc"; - IconURL = "https://git.confusedcompiler.org/favicon.ico"; - URLTemplate = "https://git.confusedcompiler.org/explore/repos?q={searchTerms}"; - } - - # Nix{,OS,pkgs} - { - Name = "NixOS Search (Package)"; - Alias = "@np"; - IconURL = "https://nixos.org/favicon.ico"; - Description = "Search in nixpkgs"; - URLTemplate = "https://search.nixos.org/packages?query={searchTerms}"; - } - { - Name = "NixOS Search (Options)"; - Alias = "@no"; - IconURL = "https://nixos.org/favicon.ico"; - Description = "Search in NixOS options"; - URLTemplate = "https://search.nixos.org/options?query={searchTerms}"; - } - - # Haskell - { - Name = "Flora"; - Alias = "@hs"; - IconURL = "https://flora.pm/static/icons/favicon-32x32.png"; - URLTemplate = "https://flora.pm/search?q={searchTerms}"; - } - - # Discourse - { - Name = "NixOS Discourse"; - Alias = "@nd"; - IconURL = "https://nixos.org/favicon.ico"; - URLTemplate = "https://discourse.nixos.org/search?q={searchTerms}"; - } - { - Name = "Framework Discourse"; - Alias = "@fd"; - IconURL = "https://frame.work/favicon.ico"; - URLTemplate = "https://community.frame.work/search?q={searchTerms}"; - } - - # Misc - { - Name = "YouTube"; - Alias = "@yt"; - IconURL = "https://youtube.com/favicon.ico"; - SuggestURLTemplate = "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt"; - URLTemplate = "https://www.youtube.com/results?search_query={searchTerms}"; - } - { - Name = "Genius"; - Alias = "@geni"; - IconURL = "https://genius.com/favicon.ico"; - URLTemplate = "https://genius.com/search?q={searchTerms}"; - } - ]; - - profiles = { - default = { - settings = { - # "full-screen-api.ignore-widgets" = true; # limit fullscreen mode to window - }; - userChrome = '' - /* monofont tweak */ - #statuspanel-label { - font-family: monospace; - } - .urlbar-input-box { - font-family: monospace; - } - ''; - extensions.packages = - let - addons = nur.repos.rycee.firefox-addons; - in - [ - addons.sponsorblock - addons.return-youtube-dislikes - addons.consent-o-matic - ]; - }; - - junk = { - id = 1; - inherit (config.programs.zen-browser.profiles.default) - settings - userChrome - ; - - extensions.packages = - let - addons = nur.repos.rycee.firefox-addons; - in - [ addons.multi-account-containers ]; - - containers = { - raisin = { - color = "purple"; - icon = "fruit"; - id = 1; - }; - pomme = { - color = "red"; - icon = "fruit"; - id = 2; - }; - }; - }; - - # Isolate it because it's proprietary - tampermonkey = { - id = 2; - inherit (config.programs.zen-browser.profiles.default) - settings - userChrome - ; - - extensions.packages = - let - addons = nur.repos.rycee.firefox-addons; - in - [ addons.tampermonkey ]; - }; - }; - }; -} diff --git a/nix/homeModules/common/firefox.nix b/nix/homeModules/common/firefox.nix index c5a1b96b..556a528d 100644 --- a/nix/homeModules/common/firefox.nix +++ b/nix/homeModules/common/firefox.nix @@ -129,15 +129,15 @@ in }; }; - # xdg.mimeApps = lib.mkIf cfg.enable { - # enable = true; - # # source: https://unix.stackexchange.com/a/684582 - # 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"; - # }; - # }; + xdg.mimeApps = lib.mkIf cfg.enable { + enable = true; + # source: https://unix.stackexchange.com/a/684582 + 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"; + }; + }; } diff --git a/nix/homeModules/common/zen-browser.nix b/nix/homeModules/common/zen-browser.nix deleted file mode 100644 index b490d95b..00000000 --- a/nix/homeModules/common/zen-browser.nix +++ /dev/null @@ -1,166 +0,0 @@ -{ - pkgs, - config, - lib, - ... -}: -let - inherit (pkgs) nur; - - cfg = config.programs.zen-browser; -in -{ - programs.zen-browser = { - # https://mozilla.github.io/policy-templates - # The following have more complex logic, keep them as policies and not profiles - policies = { - RequestedLocales = [ - "fr-FR" # for fuck sake stop showing me translated version of French gov sites - "zh-TW" - "en-US" - ]; - - SearchEngines = { - Remove = [ - "Google" - "Bing" - "DuckDuckGo" - "Qwant" - "eBay" - "Perplexity" - ]; - Default = "Brave"; - Add = [ - { - Name = "Brave"; - Alias = "@br"; - URLTemplate = "https://search.brave.com/search?q={searchTerms}&source=web"; - SuggestURLTemplate = "https://suggestqueries.google.com/complete/search?q={searchTerms}"; - } - ]; - }; - NoDefaultBookmarks = true; - DisplayMenuBar = "never"; - DisplayBookmarksToolbar = "never"; - DNSOverHTTPS = { - Enabled = false; - }; - }; - - # https://searchfox.org/mozilla-central/source/browser/components/enterprisepolicies/Policies.sys.mjs - # Some policies can be rewritten to profiles configuration - # - # TODO: try out the "locked" semantic from zen - # https://github.com/0xc000022070/zen-browser-flake/tree/main#preferences - profiles.default = { - settings = { - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "browser.tabs.loadInBackground" = true; - "browser.ctrlTab.sortByRecentlyUsed" = false; - "layout.css.devPixelsPerPx" = 1.1; - - # open links in new window - # this works a lot better with xmonad where I have a bunch of windows - "browser.link.open_newwindow" = 2; - - # Sponsored crap - # Yes - "browser.newtabpage.activity-stream.showSearch" = true; - "browser.newtabpage.activity-stream.feeds.topsites" = true; - # No - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.feeds.section.highlights" = false; - "browser.newtabpage.activity-stream.feeds.system.topstories" = false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - - # URL - # Yes - "browser.urlbar.suggest.quicksuggest.nonsponsored" = true; - # No - "browser.urlbar.suggest.quicksuggest.sponsored" = false; - - # Pasword manager - "signon.rememberSignons" = false; - "services.passwordSavingEnabled" = false; - "pref.privacy.disable_button.view_passwords" = false; - - # Hardware acceleration - "layers.acceleration.disabled" = false; - - # Screenshot - "screenshots.browser.component.enabled" = true; - - # Recommendations - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; # Addons - - # Onboarding - "browser.aboutwelcome.enabled" = false; - - # AI crap - "browser.ml.chat.enabled" = false; - "browser.ml.chat.page" = false; - "browser.ml.chat.shortcuts" = false; - "browser.ml.chat.sidebar" = false; - - # Prevent WebRTC leak - # https://mullvad.net/en/help/webrtc - "media.peerconnection.enabled" = false; - }; - - extensions.packages = - let - addons = nur.repos.rycee.firefox-addons; - in - [ - addons.ublock-origin - addons.privacy-badger - addons.user-agent-string-switcher - - /* - Here's to you who want to remove news feed eradicator because you find it annoying: - It is here to annoy you so it is less likely for you to be on the agency inversion path. - DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT. - - If you think it's annoying, go do some jump rope, sing, live. - */ - addons.news-feed-eradicator # did you read the comment above? - addons.multi-account-containers - ]; - }; - }; - - xdg.mimeApps = - let - associations = builtins.listToAttrs ( - map - (name: { - inherit name; - value = cfg.package.meta.desktopFileName; - }) - [ - "application/x-extension-shtml" - "application/x-extension-xhtml" - "application/x-extension-html" - "application/x-extension-xht" - "application/x-extension-htm" - "x-scheme-handler/unknown" - "x-scheme-handler/mailto" - "x-scheme-handler/chrome" - "x-scheme-handler/about" - "x-scheme-handler/https" - "x-scheme-handler/http" - "application/xhtml+xml" - "application/json" - "text/plain" - "text/html" - ] - ); - in - lib.mkIf cfg.enable { - associations.added = associations; - defaultApplications = associations; - }; -} diff --git a/nix/overlays/zen-browser.nix b/nix/overlays/zen-browser.nix deleted file mode 100644 index f4ffa489..00000000 --- a/nix/overlays/zen-browser.nix +++ /dev/null @@ -1,19 +0,0 @@ -let - sources = import ../../npins; -in -final: _: -let - zenpkgs = sources.zen-browser.asFlake.packages.${final.system}; -in -{ - # TODO: upstream default is broken? They default to zen-twilight - "zen-beta-unwrapped" = zenpkgs."beta-unwrapped"; - "zen-twilight-unwrapped" = zenpkgs."twilight-unwrapped"; - "zen-twilight-official-unwrapped" = zenpkgs."twilight-official-unwrapped"; - - # default - "zen-beta" = zenpkgs."beta"; - - "zen-twilight" = zenpkgs."twilight"; - "zen-twilight-official" = zenpkgs."twilight-official"; -} diff --git a/npins/sources.json b/npins/sources.json index 5ea34392..ae589196 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -368,19 +368,6 @@ "revision": "6a96aa2066d8ad945f2323b63dc217081ef51168", "url": "https://github.com/Toqozz/wired-notify/archive/6a96aa2066d8ad945f2323b63dc217081ef51168.tar.gz", "hash": "02b8pva12rzcciq5lavwk824xaym28igfsva4kikvd7mxs06ccwx" - }, - "zen-browser": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "0xc000022070", - "repo": "zen-browser-flake" - }, - "branch": "main", - "submodules": false, - "revision": "ef951ed2d976bcd1f57a09f358fdda9fa9425018", - "url": "https://github.com/0xc000022070/zen-browser-flake/archive/ef951ed2d976bcd1f57a09f358fdda9fa9425018.tar.gz", - "hash": "1s85cxiwhzwqgbazcgv12xqdlk1nkfynv23r9zj8gip4j6pznr4z" } }, "version": 5