aboutsummaryrefslogtreecommitdiff
path: root/profiles/safebrowsing.nix
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/safebrowsing.nix')
-rw-r--r--profiles/safebrowsing.nix40
1 files changed, 22 insertions, 18 deletions
diff --git a/profiles/safebrowsing.nix b/profiles/safebrowsing.nix
index 79f3c82..9a14c2c 100644
--- a/profiles/safebrowsing.nix
+++ b/profiles/safebrowsing.nix
@@ -1,4 +1,10 @@
-{ ffLib }: rec {
+{ 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.
@@ -7,26 +13,24 @@
- https://wiki.mozilla.org/Security/Application_Reputation
'';
- disableDownloads.preferences = {
- browser.safebrowsing = {
- downloads = {
- # TODO: does this do offline checks?
+ 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;
- remote = {
- enabled = false;
- url = "";
- };
+ url = "";
};
};
- };
- disablePhishing.preferences = {
- browser.safebrowsing.phishing.enabled = false;
+ phishing.enabled = mkIf (all || cfg.safebrowsing.disableDownloads) false;
+ malware.enabled = mkIf (all || cfg.safebrowsing.disableMalware) false;
};
-
- disableMalware.preferences = {
- browser.safebrowsing.malware.enabled = false;
- };
-
- disableAll = ffLib.mergeProfiles [ disableDownloads disablePhishing disableMalware ];
}