summaryrefslogtreecommitdiff
path: root/modules/desktop/firefox/default.nix
blob: e7720b20c954be723a83e5a32350a3ffe6f6df44 (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.desktop;
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;
        };
      };
    };
  };
}