2021-11-17 16:32:18 +01:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.eboskma.programs.firefox;
|
|
|
|
|
|
|
|
profileSettings = {
|
|
|
|
"devtools.theme" = "dark";
|
|
|
|
"widget.content.allow-gtk-dark-theme" = true;
|
|
|
|
"ui.key.menuAccessKeyFocuses" = false;
|
2021-11-22 08:04:54 +01:00
|
|
|
"image.avif.enabled" = true;
|
|
|
|
"image.webp.enabled" = true;
|
2021-11-17 16:32:18 +01:00
|
|
|
"privacy.webrtc.allowSilencingNotifications" = true;
|
|
|
|
"privacy.webrtc.legacyGlobalIndicator" = false;
|
2021-11-21 19:07:12 +01:00
|
|
|
"browser.shell.checkDefaultBrowser" = false;
|
2021-12-18 16:23:14 +01:00
|
|
|
"security.tls.enable_0rtt_data" = false;
|
|
|
|
"media.ffmpeg.vaapi.enabled" = true;
|
|
|
|
"media.rdd-ffmpeg.enabled" = true;
|
2022-01-31 08:10:31 +01:00
|
|
|
# "network.http.http3.enabled" = false; # Temporary workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1749908
|
2021-11-17 16:32:18 +01:00
|
|
|
};
|
2021-11-22 18:56:59 +01:00
|
|
|
|
|
|
|
nonDefaultDesktop = pkgs.makeDesktopItem {
|
|
|
|
name = "firefox-" + (if cfg.work then "private" else "horus");
|
|
|
|
desktopName = "Firefox (" + (if cfg.work then "Private" else "Horus") + ")";
|
|
|
|
exec = "firefox -P " + (if cfg.work then "private" else "horus") + " %u";
|
|
|
|
icon = "firefox";
|
|
|
|
categories = "GNOME;GTK;Network;WebBrowser";
|
|
|
|
mimeType = "text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall;";
|
|
|
|
startupNotify = "true";
|
|
|
|
extraDesktopEntries = {
|
|
|
|
"X-MultipleArgs" = "false";
|
|
|
|
};
|
|
|
|
};
|
2021-11-17 16:32:18 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options.eboskma.programs.firefox = {
|
|
|
|
enable = mkEnableOption "enable firefox";
|
|
|
|
work = mkOption {
|
|
|
|
description = "whether this is a work config";
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
programs.firefox = {
|
|
|
|
enable = true;
|
2021-11-29 08:05:46 +01:00
|
|
|
package = pkgs.firefox-bin;
|
2021-11-17 16:32:18 +01:00
|
|
|
|
|
|
|
profiles = {
|
|
|
|
private = {
|
|
|
|
id = 0;
|
|
|
|
isDefault = !cfg.work;
|
|
|
|
settings = profileSettings;
|
|
|
|
};
|
|
|
|
|
|
|
|
horus = {
|
|
|
|
id = 1;
|
|
|
|
isDefault = cfg.work;
|
|
|
|
settings = profileSettings;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-11-22 18:56:59 +01:00
|
|
|
|
|
|
|
home.packages = [ nonDefaultDesktop ];
|
2021-11-17 16:32:18 +01:00
|
|
|
};
|
|
|
|
}
|