summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/programs/firefox/engines.nix
blob: 81ee91c6275676dedd7ad031902c2ed5508996d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{ lib, pkgs }:

let
  everyday = 24 * 60 * 60 * 1000;
  nixosIcon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
  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/";
        params = [ (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/";
        params = [ (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 = nixosIcon;
      definedAliases = [ "@homemanager" "@hm" ];
    };

    "NixOS Options" = {
      urls = [{
        template = "https://search.nixos.org/options";
        params = [
          (lib.nameValuePair "channel" "unstable")
          (lib.nameValuePair "query" "{searchTerms}")
        ];
      }];
      icon = nixosIcon;
      definedAliases = [ "@nixos" "@no" ];
    };

    "NixOS Wiki" = {
      urls = [{
        template = "https://nixos.wiki/index.php";
        params = [ (lib.nameValuePair "search" "{searchTerms}") ];
      }];
      icon = nixosIcon;
      definedAliases = [ "@nixoswiki" "@nw" ];
    };

    "Nix Packages" = {
      urls = [{
        template = "https://search.nixos.org/packages";
        params = [
          (lib.nameValuePair "channel" "unstable")
          (lib.nameValuePair "query" "{searchTerms}")
        ];
      }];
      icon = nixosIcon;
      definedAliases = [ "@nixpkgs" "@np" ];
    };

    nLab = {
      urls = [{
        template = "https://ncatlab.org/nlab/search";
        params = [ (lib.nameValuePair "query" "{searchTerms}") ];
      }];
      iconUpdateURL = "https://ncatlab.org/favicon.ico";
      updateInterval = everyday;
      definedAliases = [ "@ncatlab" "@nlab" ];
    };

    Searx = {
      urls = [{
        template = "https://searx.aristote.fr/search";
        params = [ (lib.nameValuePair "q" "{searchTerms}") ];
      }];
      iconUpdateURL =
        "https://searx.aristote.fr/static/themes/oscar/img/favicon.png";
      updateInterval = everyday;
    };
  };
in self