aboutsummaryrefslogtreecommitdiff
path: root/default.nix
blob: 8fdf3e1e8144cbbd8526363d8b5e75a51df699c4 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{ pkgs ? import <nixpkgs> {} }:

with pkgs;

# Where to find documentation:
# http://kb.mozillazine.org/About:config_entries
# https://www.privacy-handbuch.de/download/moderat/user.js
# https://github.com/mozilla/policy-templates, about:policies#documentation

let
  directory = callPackage nix/directory.nix {};
  ffLib = callPackage nix/lib.nix {};
  search = callPackage nix/search.nix {};

  callProfile = p: lib.callPackageWith (pkgs // {
    inherit ffLib;
  }) p {};
in rec {
  profiles = directory.listDirectory callProfile ./profiles;

  disableErrorReporting.preferences = {
    breakpad.reportUrl = "";
  };

  activeProfiles = with profiles; [
    defaults

    addons.disableExtensionSignatureChecking
    addons.privacybadger addons.noscript
    # addons.borderify

    minimalConnections
    minimalHome
    noAccounts
    noClutter
    noMedia
    noNormandy
    noUpdates
    noStudies
    noPocket
    noTunnels
    noLocation
    safebrowsing.disableAll
    restrict
    # distrustUser

    ocsp.disabled

    forgetActivity

    { policies.RequestedLocales = [ "de-DE" "en-US" ]; }
  ];

  config = ffLib.mergeProfiles activeProfiles;
  bundleConfig = {
    inherit (config) policies;
    preferences = ffLib.flattenAttrs config.preferences;
  };

  bundle = ffLib.bundle bundleConfig;
  launcher = ffLib.launcher bundle;

/*
  bundle = profiles.bundle {
    policies = {
      Preferences = profiles.flattenAttrs {
        dom.event.contextmenu.enabled = false;

        extensions = {
          blocklist.enabled = false;
          getAddons.showPane = false;
          htmlaboutaddons.recommendations.enabled = false;
        };

        security.ssl.errorReporting.enabled = false;
      };

      SearchBar = "separate";
    };
  };
  */
}