aboutsummaryrefslogtreecommitdiff
path: root/profiles/safebrowsing.nix
blob: 9a14c2c2679cda452ed8e25fed3591c78401f59b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ 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;
  };
}