summaryrefslogtreecommitdiff
path: root/home/browsers/firefox/default.nix
blob: 608d4c529419d62ec1b05b4412af29e480fe3934 (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
{
  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.firefox;
in {
  config = mkIf cfg.enable {
    default.browser = lib.mkDefault "firefox";

    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;
      };
    };
  };
}