dotfiles/nix/configs/firefox.nix

156 lines
5.3 KiB
Nix

{ pkgs, ... }: {
home-manager.users.grape = {
programs.firefox = {
enable = true;
profiles = {
"user" = {
isDefault = true;
id = 0;
# TODO fix impurity
extraConfig = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/user.js"; # custom userjs config
userChrome = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/userChrome.css"; # browser styles
userContent = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/userContent.css"; # browser styles
extensions =
[
pkgs.nur.repos.rycee.firefox-addons.ublock-origin
pkgs.nur.repos.rycee.firefox-addons.clearurls # clear tracking urls
pkgs.nur.repos.rycee.firefox-addons.stylus # cool styling for websites
pkgs.nur.repos.rycee.firefox-addons.localcdn # locally stores frameworks such as vue, tailwind ect..
pkgs.nur.repos.rycee.firefox-addons.libredirect # redirects to libre version of spyware sites
pkgs.nur.repos.rycee.firefox-addons.tridactyl # vim like keybinds
pkgs.nur.repos.rycee.firefox-addons.istilldontcareaboutcookies # dismisses cookie banners
pkgs.nur.repos.rycee.firefox-addons.noscript # block js
pkgs.nur.repos.rycee.firefox-addons.tabliss # sexy new tab
];
search.force = true;
search.order = [ "Searxng" "DuckDuckGo" ];
search.default = "Searxng";
search.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" ];
};
"Searxng" = {
urls = [{
template = "https://search.rhscz.eu/";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
};
"Home Manager" = {
definedAliases = [ "@hm" ];
urls = [{
template = "https://mipmip.github.io/home-manager-option-search/";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
};
"Nix Options" = {
definedAliases = [ "@no" ];
urls = [{
template = "https://search.nixos.org/options?type=packages";
params = [
{ name = "query"; value = "{searchTerms}"; }
];
}];
"Stylus styles" = {
definedAliases = [ "@st" ];
urls = [{
template = " https://userstyles.world/search";
params = [
{
name = "q";
value = "{searchTerms}";
}
];
}];
};
};
};
};
};
};
};
home-manager.users.grape.programs.firefox.profiles.i2p =
{
isDefault = false;
id = 1;
extraConfig = builtins.readFile "/home/grape/dotfiles/nix/opt/firefox/i2puser.js"; # custom userjs config for i2p
extensions =
[
pkgs.nur.repos.rycee.firefox-addons.ublock-origin
pkgs.nur.repos.rycee.firefox-addons.localcdn # locally stores frameworks such as vue, tailwind ect..
pkgs.nur.repos.rycee.firefox-addons.libredirect # redirects to libre version of spyware sites
pkgs.nur.repos.rycee.firefox-addons.noscript # block js
];
search.force = true;
search.order = [ "Searxng" "DuckDuckGo" ];
search.default = "Searxng";
search.engines = {
"Searxng" = {
urls = [{
template = "http://search.itcomputes.i2p/search";
params = [
{ name = "q"; value = "{searchTerms}"; }
];
}];
};
};
bookmarks = [
{
name = "libreddit";
tags = [ "social" ];
keyword = "reddit";
url = "http://libreddit.qwik.i2p/";
}
{
name = "anonymousoverflow";
tags = [ "forum" ];
keyword = "issue";
url = "http://ocp7zhdsbl2mjabv5ma5jvbzg2dqzglieayjvyj4j2r7qvsqlboa.b32.i2p/";
}
{
name = "breezewiki";
keyword = "fandom";
url = "http://vo5og6a5cvmhyio2qdcls7awwhuhqfqutxgamam5ojkdvdaxetmq.b32.i2p/";
}
];
};
home-manager.users.grape.xdg.desktopEntries = {
"i2pfox" = {
name = "i2pfox";
genericName = "Web Browser";
exec = ''firefox -P "i2p"'';
terminal = false;
categories = [ "Application" "Network" "WebBrowser" ];
mimeType = [ "text/html" "text/xml" ];
};
};
programs.firejail = {
wrappedBinaries = {
firefox = {
executable = "${pkgs.firefox}/bin/firefox";
profile = "${pkgs.firejail}/etc/firejail/firefox.profile";
desktop = "${pkgs.firefox}/share/applications/firefox.desktop";
};
};
};
}