100 lines
3 KiB
Nix
100 lines
3 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
with lib;
|
|
let
|
|
merge = foldr (a: b: a // b) { };
|
|
cfg = config.modules.web.firefox;
|
|
in
|
|
{
|
|
options.modules.web.firefox = {
|
|
enable = mkEnableOption "enable Firefox web browser";
|
|
|
|
installPackage = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = "install Package, if false relies on distribution packages";
|
|
};
|
|
};
|
|
config = mkIf cfg.enable {
|
|
programs.browserpass = {
|
|
enable = true;
|
|
browsers = ["firefox"];
|
|
};
|
|
xdg.mimeApps.defaultApplications = {
|
|
"text/html" = "firefox.desktop";
|
|
"x-scheme-handler/http" = "firefox.desktop";
|
|
"x-scheme-handler/https" = "firefox.desktop";
|
|
"x-scheme-handler/about" = "firefox.desktop";
|
|
"x-scheme-handler/unknown" = "firefox.desktop";
|
|
};
|
|
programs.firefox = {
|
|
enable = true;
|
|
package =
|
|
if cfg.installPackage
|
|
then pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
|
nativeMessagingHosts = [
|
|
# Tridactyl native connector
|
|
pkgs.tridactyl-native
|
|
pkgs.browserpass
|
|
];
|
|
}
|
|
else null;
|
|
profiles.ephase = {
|
|
id = 0;
|
|
name = "ephase";
|
|
isDefault = true;
|
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
|
browserpass
|
|
consent-o-matic
|
|
cookie-autodelete
|
|
darkreader
|
|
decentraleyes
|
|
tridactyl
|
|
ublock-origin
|
|
];
|
|
search = {
|
|
force = true;
|
|
default = "DuckDuckGo";
|
|
engines = {
|
|
"Nix Packages" = {
|
|
urls = [{
|
|
template = "https://search.nixos.org/packages";
|
|
params = [
|
|
{ name = "type"; value = "packages"; }
|
|
{ name = "query"; value = "{searchTerms}"; }
|
|
];
|
|
}];
|
|
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
definedAliases = [ "@np" ];
|
|
};
|
|
|
|
"NixOS Wiki" = {
|
|
urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }];
|
|
iconUpdateURL = "https://nixos.wiki/favicon.png";
|
|
updateInterval = 24 * 60 * 60 * 1000; # every day
|
|
definedAliases = [ "@nw" ];
|
|
};
|
|
|
|
"Bing".metaData.hidden = true;
|
|
"Google".metaData.hidden = true;
|
|
"Amazon.fr".metaData.hidden = true;
|
|
"Facebook".metaData.hidden = true;
|
|
"youtube".metaData.hidden = true;
|
|
};
|
|
};
|
|
settings = merge [
|
|
(import ./conf/doh.nix)
|
|
(import ./conf/drm.nix)
|
|
(import ./conf/experiments.nix)
|
|
(import ./conf/extensions.nix)
|
|
(import ./conf/preferences.nix)
|
|
(import ./conf/privacy.nix)
|
|
(import ./conf/safebrowsing.nix)
|
|
(import ./conf/suggest.nix)
|
|
(import ./conf/telemetry.nix)
|
|
(import ./conf/theme.nix)
|
|
(import ./conf/tracking.nix)
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|