{ config, lib, ... }: with lib; let cfg = config.safebrowsing; all = cfg.disableAll; in { meta.description = '' Safebrowsing is a feature meant to protect the user from malicious websites and downloads. See: - https://wiki.mozilla.org/Security/Safe_Browsing - https://wiki.mozilla.org/Security/Application_Reputation ''; options.safebrowsing = { disableAll = lib.mkEnableOption "Disable all safebrowsing features"; disableDownloads = lib.mkEnableOption "Disable safebrowsing for downloads"; disablePhishing = lib.mkEnableOption "Disable safebrowsing regarding phishing"; disableMalware = lib.mkEnableOption "Disable safebrowsing regarding malware"; }; config.preferences.browser.safebrowsing = { downloads = lib.mkIf (all || cfg.disableDownloads) { # TODO: does this do offline checks? enabled = false; remote = { enabled = false; url = ""; }; }; phishing.enabled = mkIf (all || cfg.safebrowsing.disableDownloads) false; malware.enabled = mkIf (all || cfg.safebrowsing.disableMalware) false; }; }