This commit is contained in:
commit
95a533c876
451 changed files with 18255 additions and 0 deletions
51
modules/home/librewolf/default.nix
Normal file
51
modules/home/librewolf/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.librewolf;
|
||||
|
||||
inherit (lib) mkDefault mkIf;
|
||||
in
|
||||
{
|
||||
imports = [ ./search ];
|
||||
|
||||
config = {
|
||||
programs.librewolf = {
|
||||
policies.Homepage.StartPage = mkDefault "previous-session";
|
||||
profiles.default = {
|
||||
extensions.packages = import ./extensions.nix { inherit inputs pkgs; };
|
||||
settings = import ./settings.nix;
|
||||
search = {
|
||||
force = true;
|
||||
default = "Startpage";
|
||||
privateDefault = "Startpage";
|
||||
order = [ "Startpage" ];
|
||||
engines = {
|
||||
Startpage = {
|
||||
urls = [ { template = "https://www.startpage.com/do/dsearch?q={searchTerms}"; } ];
|
||||
icon = "https://www.startpage.com/sp/cdn/favicons/favicon--default.ico";
|
||||
updateInterval = 24 * 60 * 60 * 1000; # every day
|
||||
};
|
||||
# engines below are disabled
|
||||
bing.metaData.hidden = true;
|
||||
ddg.metaData.hidden = true;
|
||||
google.metaData.hidden = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables = mkIf cfg.enable (
|
||||
with cfg;
|
||||
{
|
||||
DEFAULT_BROWSER = "${package}/bin/librewolf";
|
||||
BROWSER = "${package}/bin/librewolf";
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
9
modules/home/librewolf/extensions.nix
Normal file
9
modules/home/librewolf/extensions.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ inputs, pkgs, ... }:
|
||||
|
||||
with inputs.nur.legacyPackages."${pkgs.stdenv.hostPlatform.system}".repos.rycee.firefox-addons;
|
||||
|
||||
[
|
||||
darkreader
|
||||
floccus
|
||||
ublock-origin
|
||||
]
|
||||
88
modules/home/librewolf/search/default.nix
Normal file
88
modules/home/librewolf/search/default.nix
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.librewolf;
|
||||
engines = import ./engines.nix pkgs;
|
||||
|
||||
urlRegex = "^(http|https|ftp)://";
|
||||
isUrl = s: (match urlRegex s) != null;
|
||||
|
||||
transformEngine =
|
||||
engine:
|
||||
let
|
||||
every_day = 24 * 60 * 60 * 1000;
|
||||
in
|
||||
{
|
||||
urls = [ { template = engine.url; } ];
|
||||
icon = engine.icon;
|
||||
updateInterval = if (isUrl engine.icon) then every_day else null;
|
||||
definedAliases = optional (engine ? alias) engine.alias;
|
||||
};
|
||||
|
||||
transformedEngines = mapAttrs' (name: engine: {
|
||||
name = name;
|
||||
value = transformEngine engine;
|
||||
}) engines;
|
||||
|
||||
inherit (lib)
|
||||
listToAttrs
|
||||
mapAttrs
|
||||
mapAttrs'
|
||||
mkOption
|
||||
optional
|
||||
types
|
||||
;
|
||||
inherit (lib.strings) match;
|
||||
in
|
||||
{
|
||||
options.programs.librewolf = {
|
||||
searchEngines = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [
|
||||
"github"
|
||||
"home-manager-options"
|
||||
"nixos-options"
|
||||
"nixos-wiki"
|
||||
"nixpkgs"
|
||||
"nixpkgs-issues"
|
||||
"noogle"
|
||||
"nuschtos"
|
||||
"wikiless"
|
||||
"youtube"
|
||||
];
|
||||
example = [
|
||||
"github"
|
||||
"home-manager-options"
|
||||
"howlongtobeat"
|
||||
"keyforsteam"
|
||||
"nixos-options"
|
||||
"nixos-wiki"
|
||||
"nixpkgs"
|
||||
"nixpkgs-issues"
|
||||
"noogle"
|
||||
"nuschtos"
|
||||
"protondb"
|
||||
"steamdb"
|
||||
"wikiless"
|
||||
"youtube"
|
||||
];
|
||||
description = "Additional search engines for LibreWolf.";
|
||||
};
|
||||
};
|
||||
|
||||
config.programs.librewolf = {
|
||||
profiles.default.search.engines = mapAttrs (_: name: transformedEngines.${name}) (
|
||||
listToAttrs (
|
||||
map (name: {
|
||||
name = name;
|
||||
value = name;
|
||||
}) cfg.searchEngines
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
87
modules/home/librewolf/search/engines.nix
Normal file
87
modules/home/librewolf/search/engines.nix
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
pkgs:
|
||||
|
||||
{
|
||||
github = {
|
||||
url = "https://github.com/search?q={searchTerms}";
|
||||
icon = "https://github.com/favicon.ico";
|
||||
alias = "@gh";
|
||||
};
|
||||
|
||||
home-manager-options = {
|
||||
url = "https://home-manager-options.extranix.com/?query={searchTerms}&release=release-25.11";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@hm";
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
url = "https://search.nixos.org/packages?channel=25.11&query={searchTerms}";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@np";
|
||||
};
|
||||
|
||||
nixos-options = {
|
||||
url = "https://search.nixos.org/options?channel=25.11&query={searchTerms}";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@no";
|
||||
};
|
||||
|
||||
nixos-wiki = {
|
||||
url = "https://wiki.nixos.org/w/index.php?search={searchTerms}";
|
||||
icon = "https://wiki.nixos.org/favicon.png";
|
||||
alias = "@nw";
|
||||
};
|
||||
|
||||
noogle = {
|
||||
url = "https://noogle.dev/q?term={searchTerms}";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@nf";
|
||||
};
|
||||
|
||||
nuschtos = {
|
||||
url = "https://search.xn--nschtos-n2a.de/?query={searchTerms}";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@nu";
|
||||
};
|
||||
|
||||
nixpkgs-issues = {
|
||||
url = "https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue%20state%3Aopen%20{searchTerms}";
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
alias = "@ni";
|
||||
};
|
||||
|
||||
wikiless = {
|
||||
url = "https://wikiless.metastem.su/wiki/{searchTerms}";
|
||||
icon = "https://wikiless.metastem.su/wikiless-favicon.ico";
|
||||
alias = "@wiki";
|
||||
};
|
||||
|
||||
youtube = {
|
||||
url = "https://www.youtube.com/results?search_query={searchTerms}";
|
||||
icon = "https://www.youtube.com/favicon.ico";
|
||||
alias = "@yt";
|
||||
};
|
||||
|
||||
protondb = {
|
||||
url = "https://www.protondb.com/search?q={searchTerms}";
|
||||
icon = "https://www.protondb.com/favicon.ico";
|
||||
alias = "@pdb";
|
||||
};
|
||||
|
||||
steamdb = {
|
||||
url = "https://steamdb.info/search/?a=all&q={searchTerms}";
|
||||
icon = "https://steamdb.info/favicon.ico";
|
||||
alias = "@stdb";
|
||||
};
|
||||
|
||||
keyforsteam = {
|
||||
url = "https://www.keyforsteam.de/katalog/?search_name={searchTerms}";
|
||||
icon = "https://www.keyforsteam.de/favicon.ico";
|
||||
alias = "@k4s";
|
||||
};
|
||||
|
||||
howlongtobeat = {
|
||||
url = "https://howlongtobeat.com/?q={searchTerms}";
|
||||
icon = "https://howlongtobeat.com/favicon.ico";
|
||||
alias = "@hltb";
|
||||
};
|
||||
}
|
||||
20
modules/home/librewolf/settings.nix
Normal file
20
modules/home/librewolf/settings.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"browser.cache.disk.enable" = false;
|
||||
"browser.cache.disk_cache_ssl" = false;
|
||||
"browser.cache.insecure.enable" = false;
|
||||
"browser.cache.memory.enable" = false;
|
||||
"browser.cache.offline.enable" = false;
|
||||
"browser.newtabpage.enabled" = false;
|
||||
"browser.startup.homepage" = "chrome://browser/content/blanktab.html";
|
||||
"browser.toolbars.bookmarks.visibility" = "never";
|
||||
"browser.urlbar.shortcuts.history" = false;
|
||||
"browser.urlbar.shortcuts.tabs" = false;
|
||||
"browser.urlbar.suggest.history" = false;
|
||||
"browser.urlbar.suggest.openpage" = false;
|
||||
"browser.urlbar.suggest.recentsearches" = false;
|
||||
"places.history.enabled" = false;
|
||||
"plugin.scan.plid.all" = false;
|
||||
"privacy.donottrackheader.enabled" = true;
|
||||
"sidebar.revmap" = true;
|
||||
"sidebar.verticalTabs" = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue