hylonix/modules/home-manager/gecko-browser/gecko-lib/policies.nix
hylodon 0f0c4c7727 Added a module to configure browser based on the gecko engine, such as Firefox.
This module should provide similar functionality to the firefox module in
home-manager. Some notable differences between the two include:

* home-manager configures a single browser. This means that any configuration
  that cannot be done on a per-profile basis is shared between all
  profiles. This module configures a new copy of the browser for every profile,
  ensuring that *all* configuration can be on a per-profile basis.

  This might be seen as insanity in a regular distro, but in NixOS this is
  trivial to do and requires no extra storage space.

* home-manager modifies files in the user's directory to configure things such
  as extensions and search engines. This module avoids that when possible by
  pushing configuration into policies and preferences at a browser level.
  This is much nicer for impermanence-based systems.
2026-02-22 19:57:42 +00:00

32 lines
770 B
Nix

{ pkgs, lib, ... }:
let
type =
let
jsonFormat = pkgs.formats.json { };
in
jsonFormat.type;
in
{
inherit type;
options = {
policies = lib.mkOption {
inherit type;
default = { };
description = "[See list of policies](https://mozilla.github.io/policy-templates/).";
example = {
DefaultDownloadDirectory = "\${home}/Downloads";
BlockAboutConfig = true;
ExtensionSettings = {
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
default_area = "menupanel";
private_browsing = true;
};
};
};
};
};
}