grimm-nixos-laptop/common/firefox.nix

86 lines
2.3 KiB
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
pkgs,
config,
lib,
...
}:
2024-04-10 16:51:28 +02:00
let
2024-05-11 22:55:59 +02:00
inherit (config.grimmShared)
enable
firefox
tooling
locale
sway
;
inherit (lib)
mkIf
optionals
mapAttrs
optionalAttrs
;
2024-04-10 16:51:28 +02:00
in
{
2024-05-11 22:55:59 +02:00
config = mkIf (enable && firefox.enable) {
environment.systemPackages =
[ ]
++ optionals config.services.desktopManager.plasma6.enable [ pkgs.plasma-browser-integration ];
2024-03-24 16:59:47 +01:00
2024-05-11 22:55:59 +02:00
programs.firefox = {
2024-05-18 16:41:17 +02:00
# package = pkgs.firefox-beta;
2024-05-11 22:55:59 +02:00
enable = true;
nativeMessagingHosts.packages =
[ ]
++ lib.optionals (tooling.enable && tooling.pass) [ pkgs.passff-host ];
languagePacks = optionals locale [
"de"
"en-US"
];
policies = {
ExtensionSettings =
2024-09-21 09:43:57 +02:00
# (mkIf firefox.disableUserPlugins { "*".installation_mode = "blocked"; }) //
(mapAttrs (guid: shortId: {
2024-05-11 22:55:59 +02:00
# explicit plugins by config
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "force_installed";
2024-09-21 09:43:57 +02:00
}) config.grimmShared.firefox.plugins);
2024-05-11 22:55:59 +02:00
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
2024-05-07 23:31:41 +02:00
};
2024-05-11 22:55:59 +02:00
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
Preferences = {
"pdfjs.enableScripting" = false;
"media.hardware-video-decoding.enabled" = true;
"media.ffmpeg.vaapi.enabled" = true;
2024-09-21 09:43:57 +02:00
"network.dns.disableIPv6" = true;
2024-05-11 22:55:59 +02:00
"media.rdd-ffmpeg.enabled" = true;
"media.navigator.mediadatadecoder_vpx_enabled" = true;
} // optionalAttrs sway.enable { "browser.tabs.inTitlebar" = 0; };
2024-03-24 16:59:47 +01:00
};
};
2024-05-11 22:55:59 +02:00
};
options.grimmShared.firefox = with lib; {
enable = mkEnableOption "grimm-firefox";
plugins = mkOption {
type = types.attrsOf types.str;
default = { };
description = "set of plugins to install. Format: guid = short-id";
};
2024-05-11 22:55:59 +02:00
disableUserPlugins = mkEnableOption "disables user controlled plugins";
};
2024-03-24 16:59:47 +01:00
}