nichts/modules/gui/firefox.nix

31 lines
876 B
Nix
Raw Normal View History

2024-04-13 18:59:58 +02:00
{ config, lib, inputs, pkgs, ... }:
with lib; let
username = config.modules.other.system.username;
2024-04-13 19:03:30 +02:00
cfg = config.modules.programs.firefox;
2024-04-13 18:59:58 +02:00
in {
2024-04-13 19:03:30 +02:00
options.modules.programs.firefox = {
2024-04-13 18:59:58 +02:00
enable = mkEnableOption "firefox";
extensions = mkOption {
description = "firefox extensions (format like https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265)";
type = types.attrs;
default = {};
};
};
config = mkIf cfg.enable {
home-manager.users.${username} = {
2024-04-13 19:03:30 +02:00
programs.firefox = lib.mkMerge [{
2024-04-13 18:59:58 +02:00
enable = true;
policies = {
ExtensionSettings = {
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
};
};
2024-04-13 19:03:30 +02:00
} cfg.extensions];
2024-04-13 18:59:58 +02:00
};
};
}