summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/programs/firefox/engines.nix
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2023-03-04 18:08:55 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2023-03-04 18:08:55 +0100
commitd1b575c1248879ddc477da16544d6727f928c472 (patch)
treef25d0af0c1e686c980d19eacaf730e7f4e0ca0c0 /modules/home-manager/personal/programs/firefox/engines.nix
parent507097cba89eaf6824d815f6432cb337e56a3507 (diff)
home: firefox: add search engines
Diffstat (limited to 'modules/home-manager/personal/programs/firefox/engines.nix')
-rw-r--r--modules/home-manager/personal/programs/firefox/engines.nix121
1 files changed, 114 insertions, 7 deletions
diff --git a/modules/home-manager/personal/programs/firefox/engines.nix b/modules/home-manager/personal/programs/firefox/engines.nix
index 7ea2830..e04cc2e 100644
--- a/modules/home-manager/personal/programs/firefox/engines.nix
+++ b/modules/home-manager/personal/programs/firefox/engines.nix
@@ -1,8 +1,115 @@
-{
- Searx = {
- urls = [{ template = "https://searx.aristote.fr/search?q={searchTerms}"; }];
- iconUpdateURL =
- "https://searx.aristote.fr/static/themes/oscar/img/favicon.png";
- updateInterval = 24 * 60 * 60 * 1000; # every day
+{ lib, pkgs }:
+
+let
+ everyday = 24 * 60 * 60 * 1000;
+ self = {
+ disable = engines: lib.genAttrs engines (name: { metadata.hidden = true; });
+ disableDefault = self.disable [ "Google" "Amazon.fr" "Bing" ];
+
+ nix = {
+ inherit (self) "Home Manager Options" "NixOS Options" "NixOS Wiki" "Nix Packages";
+ };
+ dev = self.nix // { inherit (self) AlternativeTo; };
+ personal = { inherit (self) Emojipedia; };
+ work = { inherit (self) nLab; };
+ all = self.dev // self.personal // self.work // { inherit (self) Searx; };
+
+ Emojipedia = {
+ urls = [{
+ template = "https://emojipedia.org/search/?";
+ parameters = [ (lib.nameValuePair "q" "{searchTerms}") ];
+ }];
+
+ iconUpdateURL =
+ "https://emojipedia.org/static/img/favicons/favicon-16x16.png";
+ updateInterval = everyday;
+
+ definedAliases = [ "@emojipedia" "@emoji" "@em" ];
+ };
+
+ AlternativeTo = {
+ urls = [{
+ template = "https://alternativeto.net/browse/search/?";
+ parameters = [ (lib.nameValuePair "q" "{searchTerms}") ];
+ }];
+
+ iconUpdateURL =
+ "https://alternativeto.net/static/icons/a2/favicon-16x16.png";
+ updateInterval = everyday;
+
+ definedAliases = [ "@alternativeto" "@a2" ];
+ };
+
+ "Home Manager Options" = {
+ urls = [{
+ template =
+ "https://mipmip.github.io/home-manager-option-search/?{searchTerms}";
+ }];
+
+ icon =
+ "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+
+ definedAliases = [ "@homemanager" "@hm" ];
+ };
+
+ "NixOS Options" = {
+ urls = [{
+ template = "https://search.nixos.org/options";
+ parameters = [
+ (lib.nameValuePair "channel" "unstable")
+ (lib.nameValuePair "query" "{searchTerms}")
+ ];
+
+ icon =
+ "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@nixos" "@no" ];
+ }];
+ };
+
+ "NixOS Wiki" = {
+ urls = [{
+ template = "https://nixos.wiki/index.php?";
+ parameters = [ (lib.nameValuePair "search" "{searchTerms}") ];
+ }];
+ iconUpdateURL = "https://nixos.wiki/favicon.png";
+ updateInterval = everyday;
+ definedAliases = [ "@nixoswiki" "@nw" ];
+ };
+
+ "Nix Packages" = {
+ urls = [{
+ template = "https://search.nixos.org/packages";
+ parameters = [
+ (lib.nameValuePair "channel" "unstable")
+ (lib.nameValuePair "query" "{searchTerms}")
+ ];
+
+ icon =
+ "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
+ definedAliases = [ "@nixpkgs" "@np" ];
+ }];
+ };
+
+ nLab = {
+ urls = {
+ template = "https://ncatlab.org/nlab/search?";
+ parameters = [ (lib.nameValuePair "query" "{searchTerms}") ];
+ };
+
+ iconUpdateURL = "https://ncatlab.org/favicon.ico";
+ updateInterval = everyday;
+
+ definedAliases = [ "@ncatlab" "@nlab" ];
+ };
+
+ Searx = {
+ urls = [{
+ template = "https://searx.aristote.fr/search?";
+ parameters = [ (lib.nameValuePair "q" "{searchTerms}") ];
+ }];
+ iconUpdateURL =
+ "https://searx.aristote.fr/static/themes/oscar/img/favicon.png";
+ updateInterval = everyday;
+ };
};
-}
+in self