summaryrefslogtreecommitdiff
path: root/home-manager/firefox.nix
blob: 0a3b922b9220316d887e71c4b720b9d2cd2946ae (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
{ config, pkgs, theme, ... }:

let
  firefox-i2p = pkgs.writeShellScriptBin "firefox-i2p" ''firefox -p i2p'';
  firefox-work = pkgs.writeShellScriptBin "firefox-work" ''firefox -p work'';

  # Show all packages - `nix flake show "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"`
  default-extensions = with pkgs.nur.repos.rycee.firefox-addons; [
    ublock-origin
    decentraleyes
    clearurls
    darkreader
    noscript

    # ImageBlock - Blure Images
    # ClearlyRead

    # privacy-badger
  ];

  default-settings = {
    "browser.search.region" = "US";

    "app.normandy.first_run" = false;
    "toolkit.telemetry.reportingpolicy.firstRun" = false;
    "trailhead.firstrun.didSeeAboutWelcome" = true;

    "browser.startup.homepage" = "https://jptrzy.xyz";

    "browser.compactmode.show" = true;
    "browser.uidensity" = 1;
    #"browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["ublock0_raymondhill_net-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","customizableui-special-spring6","urlbar-container","customizableui-special-spring7","downloads-button","jid1-mnnxcxisbpnsxq_jetpack-browser-action","unified-extensions-button"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["personal-bookmarks"]},"seen":["save-to-pocket-button","jid1-mnnxcxisbpnsxq_jetpack-browser-action","ublock0_raymondhill_net-browser-action","developer-button"],"dirtyAreaCache":["unified-extensions-area","nav-bar","TabsToolbar","widget-overflow-fixed-list","PersonalToolbar"],"currentVersion":19,"newElementCount":7}'';

    "media.ffmpeg.vaapi.enabled" = true;
    #"xpinstall.signatures.required" = false; # TODO - it is a security issue
  };
in {
  programs.firefox = {
    enable = true;

    package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
      # https://github.com/mozilla/policy-templates#enterprisepoliciesenabled
      extraPolicies = {
        CaptivePortal = false;
        DisableFirefoxStudies = true;
        DisablePocket = true;
        DisableTelemetry = true;
        DisableFirefoxAccounts = true;
        NoDefaultBookmarks = true;
        OfferToSaveLogins = false;
        OfferToSaveLoginsDefault = false;
        PasswordManagerEnabled = false;
        FirefoxHome = {
          Search = true;
          Pocket = false;
          Snippets = false;
          TopSites = false;
          Highlights = false;
        };
        UserMessaging = {
          ExtensionRecommendations = false;
          SkipOnboarding = true;
        };
      };
    };

    profiles = {
      i2p = {
        isDefault = false; id = 2;
        name = "i2p";

        settings = {
          "javascript.enabled" = false;
          "keyword.enabled" = true;

          "network.proxy.type" = 1;
          "network.proxy.share_proxy_settings" = true;

          "network.proxy.http" = "127.0.0.1";
          "network.proxy.http_port" = 4444;

          "network.proxy.ssl" = "127.0.0.1";
          "network.proxy.ssl_port" = 4444;
        };
      };

      work = {
        isDefault = false; id = 1;
        name = "work";

        extensions = default-extensions;
        settings = default-settings;
      };

      default = {
        isDefault = true; id = 0;
        name = "main";

        extensions = default-extensions;
        settings = default-settings;
      };
    };
  };

  home.packages = [
    firefox-i2p
    firefox-work
  ];
}
Software created with 💖