From 5b51c3986309100b6890c1ea64c1e4af3f13bf20 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Thu, 27 Jun 2024 22:36:06 -0400 Subject: [PATCH] aly/firefox: add xdg desktop entry forwork profile and reorg --- homes/aly/default.nix | 181 +------------------- homes/aly/{ => firefox}/bookmarks-work.html | 0 homes/aly/firefox/default.nix | 140 +++++++++++++++ 3 files changed, 144 insertions(+), 177 deletions(-) rename homes/aly/{ => firefox}/bookmarks-work.html (100%) create mode 100644 homes/aly/firefox/default.nix diff --git a/homes/aly/default.nix b/homes/aly/default.nix index 3eb984e7..bfb5dcf0 100644 --- a/homes/aly/default.nix +++ b/homes/aly/default.nix @@ -6,6 +6,10 @@ self, ... }: { + imports = [ + ./firefox + ]; + home = { homeDirectory = "/home/aly"; @@ -37,183 +41,6 @@ programs = { home-manager.enable = true; - firefox = { - enable = true; - - profiles.work = { - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - decentraleyes - keepassxc-browser - ublock-origin - consent-o-matic - zoom-redirector - ]; - - settings = { - "browser.bookmarks.file" = "${./bookmarks-work.html}"; - "browser.places.importBookmarksHTML" = true; - "browser.toolbars.bookmarks.visibility" = "newtab"; - "identity.fxaccounts.enabled" = false; - "network.cookie.cookieBehavior" = 1; - "privacy.donottrackheader.enabled" = true; - "privacy.fingerprintingProtection" = true; - "privacy.trackingprotection.emailtracking.enabled" = true; - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.global-checkbox.enabled" = true; - "privacy.trackingprotection.socialtracking.enabled" = true; - "signon.rememberSignons" = false; - }; - - id = 1; - - search = { - default = "Google"; - force = true; - engines = { - "Bing" = { - metaData = { - hidden = true; - alias = "!bing"; - }; - }; - "DuckDuckGo" = { - metaData = { - hidden = true; - alias = "!ddg"; - }; - }; - }; - }; - }; - - profiles.default = { - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - augmented-steam - decentraleyes - keepassxc-browser - omnivore - sidebery - sponsorblock - ublock-origin - zoom-redirector - ]; - - id = 0; - - search = { - default = "DuckDuckGo"; - force = true; - engines = { - "nixpkgs" = { - 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 = ["!nix"]; - }; - - "Bing" = { - metaData = { - hidden = true; - alias = "!bing"; - }; - }; - "Google" = { - metaData = { - hidden = true; - alias = "!google"; - }; - }; - }; - }; - - settings = { - "browser.toolbars.bookmarks.visibility" = "newtab"; - "network.cookie.cookieBehavior" = 1; - "permissions.default.desktop-notification" = 2; - "privacy.donottrackheader.enabled" = true; - "privacy.fingerprintingProtection" = true; - "privacy.trackingprotection.emailtracking.enabled" = true; - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.global-checkbox.enabled" = true; - "privacy.trackingprotection.socialtracking.enabled" = true; - "services.sync.prefs.sync.browser.uiCustomization.state" = true; - - # "browser.uiCustomization.state" = '' - # { - # "placements": { - # "widget-overflow-fixed-list": [], - # "unified-extensions-area": [ - # "ublock0_raymondhill_net-browser-action", - # "sponsorblocker_ajay_app-browser-action", - # "_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action", - # "jid1-bofifl9vbdl2zq_jetpack-browser-action" - # ], - # "nav-bar": [ - # "back-button", - # "forward-button", - # "stop-reload-button", - # "customizableui-special-spring1", - # "urlbar-container", - # "customizableui-special-spring2", - # "downloads-button", - # "save-extension_omnivore_app-browser-action", - # "keepassxc-browser_keepassxc_org-browser-action", - # "_3c078156-979c-498b-8990-85f7987dd929_-browser-action", - # "unified-extensions-button", - # "fxa-toolbar-menu-button" - # ], - # "toolbar-menubar": [ - # "menubar-items" - # ], - # "TabsToolbar": [ - # "firefox-view-button", - # "tabbrowser-tabs", - # "new-tab-button", - # "alltabs-button" - # ], - # "PersonalToolbar": [ - # "personal-bookmarks" - # ] - # }, - # "seen": [ - # "save-extension_omnivore_app-browser-action", - # "_019b606a-6f61-4d01-af2a-cea528f606da_-browser-action", - # "sponsorblocker_ajay_app-browser-action", - # "developer-button", - # "keepassxc-browser_keepassxc_org-browser-action", - # "ublock0_raymondhill_net-browser-action", - # "jid1-bofifl9vbdl2zq_jetpack-browser-action", - # "_3c078156-979c-498b-8990-85f7987dd929_-browser-action" - # ], - # "dirtyAreaCache": [ - # "unified-extensions-area", - # "nav-bar", - # "toolbar-menubar", - # "TabsToolbar", - # "PersonalToolbar" - # ], - # "currentVersion": 20, - # "newElementCount": 4 - # } - # ''; - }; - }; - }; - git = { enable = true; userName = "Aly Raffauf"; diff --git a/homes/aly/bookmarks-work.html b/homes/aly/firefox/bookmarks-work.html similarity index 100% rename from homes/aly/bookmarks-work.html rename to homes/aly/firefox/bookmarks-work.html diff --git a/homes/aly/firefox/default.nix b/homes/aly/firefox/default.nix new file mode 100644 index 00000000..8584b096 --- /dev/null +++ b/homes/aly/firefox/default.nix @@ -0,0 +1,140 @@ +{ + config, + inputs, + lib, + pkgs, + self, + ... +}: { + programs.firefox = { + enable = true; + + profiles.work = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + consent-o-matic + decentraleyes + keepassxc-browser + ublock-origin + zoom-redirector + ]; + + settings = { + "browser.bookmarks.file" = "${./bookmarks-work.html}"; + "browser.places.importBookmarksHTML" = true; + "browser.toolbars.bookmarks.visibility" = "newtab"; + "identity.fxaccounts.enabled" = false; + "network.cookie.cookieBehavior" = 1; + "privacy.donottrackheader.enabled" = true; + "privacy.fingerprintingProtection" = true; + "privacy.trackingprotection.emailtracking.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.global-checkbox.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + "signon.rememberSignons" = false; + }; + + id = 1; + + search = { + default = "Google"; + force = true; + engines = { + "Bing" = { + metaData = { + hidden = true; + alias = "!bing"; + }; + }; + "DuckDuckGo" = { + metaData = { + hidden = true; + alias = "!ddg"; + }; + }; + }; + }; + }; + + profiles.default = { + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + augmented-steam + decentraleyes + keepassxc-browser + omnivore + sidebery + sponsorblock + ublock-origin + zoom-redirector + ]; + + id = 0; + + search = { + default = "DuckDuckGo"; + force = true; + engines = { + "nixpkgs" = { + 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 = ["!nix"]; + }; + + "Bing" = { + metaData = { + hidden = true; + alias = "!bing"; + }; + }; + "Google" = { + metaData = { + hidden = true; + alias = "!google"; + }; + }; + }; + }; + + settings = { + "browser.toolbars.bookmarks.visibility" = "newtab"; + "network.cookie.cookieBehavior" = 1; + "permissions.default.desktop-notification" = 2; + "privacy.donottrackheader.enabled" = true; + "privacy.fingerprintingProtection" = true; + "privacy.trackingprotection.emailtracking.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.global-checkbox.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + "services.sync.prefs.sync.browser.uiCustomization.state" = true; + }; + }; + }; + + xdg.desktopEntries.firework = { + categories = ["Application" "Network" "WebBrowser"]; + exec = "firefox -p work --name firework %U"; + genericName = "Web Browser"; + icon = "firefox"; + mimeType = ["text/html" "text/xml"]; + name = "Firefox (work)"; + startupNotify = true; + terminal = false; + settings = { + StartupWMClass = "firework"; + }; + }; +}