summaryrefslogtreecommitdiff
path: root/modules/browsers/firefox/default.nix
blob: 61a5db050c914379a9aa3f9095a87978e5db3ae1 (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
{
  config,
  lib,
  pkgs,
  ...
}: let
  extraPrefs = lib.fileContents ./mozilla.cfg;
  userChrome = lib.fileContents ./userChrome.css;
  my-firefox = pkgs.firefox.override {
    extraPrefs = extraPrefs;
  };

  inherit (lib) mkIf;
  cfg = config.browsers;
in {
  config = mkIf cfg.firefox {
    default.browser = lib.mkDefault "firefox";

    home-manager.users.${config.user} = {
      programs.firefox = {
        enable = true;
        package = my-firefox;

        # import configuration
        policies = import ./policies.nix;

        # create profile for me :3
        profiles.${config.user} = {
          search = {
            force = true;
            default = "ddg";
          };

          userChrome = userChrome;
        };
      };
    };
  };
}