summaryrefslogtreecommitdiff
path: root/modules/browsers/firefox/default.nix
blob: 51f9000959b77c5166acad1ba5e3d657e5c8e236 (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 = import ./extraPrefs.nix;
  userChrome = import ./userChrome.nix;
  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 ./policy.nix;

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

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