nixos-config/home-manager/modules/firefox/default.nix

130 lines
3.8 KiB
Nix
Raw Normal View History

2024-02-05 11:46:52 +01:00
{
pkgs,
config,
lib,
...
2022-03-01 22:19:03 +01:00
}:
2024-02-05 11:46:52 +01:00
with lib;
let
2021-11-17 16:32:18 +01:00
cfg = config.eboskma.programs.firefox;
profileSettings = {
"app.shield.optoutstudies.enabled" = false;
"beacon.enabled" = false;
"breakpad.reportURL" = "";
2024-02-28 22:48:22 +01:00
"browser.chrome.guess_favicon" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit" = false;
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
"browser.crashReports.unsubmittedCheck.enabled" = false;
2023-10-03 10:47:28 +02:00
"browser.shell.checkDefaultBrowser" = false;
"browser.tabs.crashReporting.sendReport" = false;
2023-10-03 10:47:28 +02:00
"browser.translations.enable" = false;
"browser.urlbar.trimURLs" = false;
2024-05-07 17:13:33 +02:00
"dom.event.contextmenu.enabled" = false;
2021-11-17 16:32:18 +01:00
"devtools.theme" = "dark";
"experiments.activeExperiment" = false;
"experiments.enabled" = false;
"experiments.manifest.uri" = "";
"experiments.supported" = false;
2023-10-03 10:47:28 +02:00
"extensions.quarantinedDomains.enabled" = false;
"gfx.webrender.all" = true;
2021-11-22 08:04:54 +01:00
"image.avif.enabled" = true;
"image.webp.enabled" = true;
2023-10-03 10:47:28 +02:00
"media.ffmpeg.vaapi.enabled" = true;
"media.rdd-ffmpeg.enabled" = true;
"network.allow-experimens" = false;
"privacy.query_stripping" = true;
2021-11-17 16:32:18 +01:00
"privacy.webrtc.allowSilencingNotifications" = true;
"privacy.webrtc.legacyGlobalIndicator" = false;
2021-12-18 16:23:14 +01:00
"security.tls.enable_0rtt_data" = false;
"services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" = false;
"toolkit.telemetry.archive.enabled" = false;
"toolkit.telemetry.bhrPing.enabled" = false;
"toolkit.telemetry.cachedClientID" = "";
"toolkit.telemetry.enabled" = false;
"toolkit.telemetry.firstShutdownPing.enabled" = false;
"toolkit.telemetry.hybridContent.enabled" = false;
"toolkit.telemetry.newProfilePing.enabled" = false;
"toolkit.telemetry.prompted" = 2;
"toolkit.telemetry.rejected" = true;
"toolkit.telemetry.reportingpolicy.firstRun" = false;
"toolkit.telemetry.server" = "";
"toolkit.telemetry.shutdownPingSender.enabled" = false;
"toolkit.telemetry.unified" = false;
"toolkit.telemetry.unifiedIsOptIn" = false;
"toolkit.telemetry.updatePing.enabled" = false;
2023-10-03 10:47:28 +02:00
"ui.key.menuAccessKeyFocuses" = false;
"widget.content.allow-gtk-dark-theme" = true;
2021-11-17 16:32:18 +01:00
};
2021-11-22 18:56:59 +01:00
nonDefaultDesktop = pkgs.makeDesktopItem {
2024-02-05 11:46:52 +01:00
name = "firefox-" + (if cfg.work then "private" else "horus");
desktopName = "Firefox (" + (if cfg.work then "Personal" else "Horus") + ")";
exec = "firefox -P " + (if cfg.work then "private" else "horus") + " %u";
2021-11-22 18:56:59 +01:00
icon = "firefox";
2024-02-05 11:46:52 +01:00
categories = [
"GNOME"
"GTK"
"Network"
"WebBrowser"
];
2022-03-09 11:11:24 +01:00
mimeTypes = [
"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;
extraConfig = {
2021-11-22 18:56:59 +01:00
"X-MultipleArgs" = "false";
};
};
in
{
2021-11-17 16:32:18 +01:00
options.eboskma.programs.firefox = {
enable = mkEnableOption "enable firefox";
work = mkOption {
description = "whether this is a work config";
type = types.bool;
default = false;
};
};
2022-05-03 18:17:38 +02:00
config = mkIf cfg.enable {
2021-11-17 16:32:18 +01:00
programs.firefox = {
enable = true;
package = pkgs.wrapFirefox (pkgs.firefox-unwrapped.override {
pipewireSupport = true;
ffmpegSupport = true;
}) { };
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
};
}