From a16754ff06b7db478a9252bb6159652818cdad0d Mon Sep 17 00:00:00 2001 From: Arpit Chakladar Date: Sun, 2 Aug 2026 02:50:10 +0530 Subject: feat: added example to use pgp signing of emails, fixed browserpass - Added example on how to enable pgp signing on gmail email accounts - The programs.browserpass.enable option only used extension ids for the actual extensions not for the custom extension key we gave it. So we are updaing the com.github.browserpass.native.json file to manually add our own extension id to it --- modules/web/chromium/default.nix | 149 ++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 81 deletions(-) (limited to 'modules/web/chromium/default.nix') diff --git a/modules/web/chromium/default.nix b/modules/web/chromium/default.nix index 2cd9fc1..8a86a5a 100644 --- a/modules/web/chromium/default.nix +++ b/modules/web/chromium/default.nix @@ -7,7 +7,7 @@ { imports = [ ./browserpass.nix - ./extensions/assertions.nix + ./extensions ]; options.web.chromium = { @@ -29,93 +29,80 @@ }; }; - config = lib.mkIf config.web.chromium.enable ( - let - exts = import ./extensions { - inherit lib pkgs config; - checkForUpdates = config.web.chromium.checkForUpdates; - }; - - extensionDirs = [ - exts.aria2Explorer.drv - exts.browserpass.drv - exts.darkMode.drv - exts.searxngHome.drv - exts.theme.drv - exts.ublockOrigin.drv - ]; - - pinnedIds = lib.filter (id: id != null) [ - exts.browserpass.id - exts.darkMode.id - exts.ublockOrigin.id - ]; - in - { - programs.chromium = { - enable = true; - package = pkgs.ungoogled-chromium; - commandLineArgs = [ + config = lib.mkIf config.web.chromium.enable { + programs.chromium = { + enable = true; + package = pkgs.ungoogled-chromium; + commandLineArgs = + let + extensionDirs = lib.concatStringsSep "," ( + lib.mapAttrsToList (_: ext: ext.drv) config.web.chromium.extensions + ); + in + [ "--force-device-scale-factor=1.15" - "--load-extension=${lib.concatStringsSep "," extensionDirs}" + "--load-extension=${extensionDirs}" ]; - }; + }; - xdg.mimeApps.defaultApplications = { - "x-scheme-handler/http" = "chromium-browser.desktop"; - "x-scheme-handler/https" = "chromium-browser.desktop"; - "x-scheme-handler/chrome" = "chromium-browser.desktop"; - "text/html" = "chromium-browser.desktop"; - "application/xhtml+xml" = "chromium-browser.desktop"; - }; + xdg.mimeApps.defaultApplications = { + "x-scheme-handler/http" = "chromium-browser.desktop"; + "x-scheme-handler/https" = "chromium-browser.desktop"; + "x-scheme-handler/chrome" = "chromium-browser.desktop"; + "text/html" = "chromium-browser.desktop"; + "application/xhtml+xml" = "chromium-browser.desktop"; + }; - xdg.configFile."chromium/Default/Preferences" = { - force = true; - text = builtins.toJSON { - NewTabPage = { - FooterVisible = false; - }; - bookmark_bar = { - show_on_all_tabs = false; - }; - browser = { - show_full_urls = true; - theme = { - follows_system_colors = true; - }; - }; - search = { - suggest_enabled = false; - }; - url_handling = { - show_full_urls = true; - }; - autofill = { - profile_enabled = false; - credit_card_enabled = false; - }; - vertical_tabs = { - collapsed_state = true; - enabled = true; - enabled_first_time = true; - uncollapsed_width = 240; + xdg.configFile."chromium/Default/Preferences" = { + force = true; + text = builtins.toJSON { + NewTabPage = { + FooterVisible = false; + }; + bookmark_bar = { + show_on_all_tabs = false; + }; + browser = { + show_full_urls = true; + theme = { + follows_system_colors = true; }; - credentials_enable_service = false; - credentials_enable_autosignin = false; - extensions = { - pinned_extensions = pinnedIds; - ui = { - developer_mode = true; - }; + }; + search = { + suggest_enabled = false; + }; + url_handling = { + show_full_urls = true; + }; + autofill = { + profile_enabled = false; + credit_card_enabled = false; + }; + vertical_tabs = { + collapsed_state = true; + enabled = true; + enabled_first_time = true; + uncollapsed_width = 240; + }; + credentials_enable_service = false; + credentials_enable_autosignin = false; + extensions = { + pinned_extensions = [ + config.web.chromium.extensions.browserpass.id + config.web.chromium.extensions.darkMode.id + config.web.chromium.extensions.ublockOrigin.id + ]; + ui = { + developer_mode = true; }; - profile = { - default_content_setting_values = { - notifications = 2; - }; + }; + profile = { + default_content_setting_values = { + notifications = 2; }; - high_efficiency_mode_enabled = true; }; + high_efficiency_mode_enabled = true; }; - } - ); + }; + }; } -- cgit v1.2.3