aboutsummaryrefslogtreecommitdiff
path: root/profiles/safebrowsing.nix
diff options
context:
space:
mode:
authortilpner2020-06-15 09:53:06 +0200
committertilpner2020-06-15 09:53:06 +0200
commit367b0c114f38d5c332f5ee971ad13dd69e302dec (patch)
treeec0c5ee3e7e1f0a30517599e51bd0c8172635158 /profiles/safebrowsing.nix
parent2992d92e6ce0d7c96ccded0747d8815d8cfed956 (diff)
downloadfirefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.tar.gz
firefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.tar.xz
firefox-profiles-367b0c114f38d5c332f5ee971ad13dd69e302dec.zip
WIP towards module based configuration
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 ];
}