modules/nixos: add more search engines

This commit is contained in:
Dmitriy Pleshevskiy 2024-04-18 18:18:53 +03:00
parent 96f4239510
commit 70d3eb824c
Signed by: pleshevskiy
GPG Key ID: 17041163DA10A9A2
4 changed files with 24 additions and 6 deletions

View File

@ -9,6 +9,7 @@ let
withPassffAddon = isPassEnabled;
withRedirectorAddon = true;
withSidebarTabsAddon = true;
withAllSearchEngines = true;
};
librewolf' = with pkgs.unstable; librewolf.override {

View File

@ -7,6 +7,7 @@ let
firefoxAddons = inputs.firefox-addons.packages."${pkgs.system}";
withRedirectorAddon = true;
withSidebarTabsAddon = true;
withAllSearchEngines = true;
};
mullvadBrowser = pkgs.mullvad-browser.overrideAttrs (attrs: {

View File

@ -2,7 +2,8 @@
, withPassffAddon ? false
, withRedirectorAddon ? false
, withSidebarTabsAddon ? false
, firefoxAddons
, withAllSearchEngines ? false
, firefoxAddons ? { }
, lib
, writeText
, ...
@ -33,6 +34,7 @@ writeText "policies.json" (builtins.toJSON {
IconURL = "https://search.sapti.me/static/themes/simple/img/favicon.png";
URLTemplate = "https://search.sapti.me/search?q={searchTerms}";
}
] ++ lib.optionals withAllSearchEngines [
{
Alias = "np";
Name = "NixOS Packages";
@ -47,6 +49,23 @@ writeText "policies.json" (builtins.toJSON {
IconURL = "https://nixos.org/favicon.png";
URLTemplate = "https://search.nixos.org/options?query={searchTerms}";
}
{
Alias = "ng";
Name = "Noogle";
Description = "Search for nix functions by name.";
IconURL = "https://noogle.dev/favicon.png";
URLTemplate = "https://noogle.dev/q?term={searchTerms}";
}
{
Alias = "hg";
Name = "Hoogle";
Description = ''
Hoogle is a Haskell API search engine, which allows you to
search many standard Haskell libraries by either function name,
or by approximate type signature.'';
URLTemplate = "https://hoogle.haskell.org/?hoogle={searchTerms}";
IconURL = "https://hoogle.haskell.org/favicon64.png";
}
];
Default = "SearXNG";
Remove = [

View File

@ -1,11 +1,9 @@
{ config, pkgs, lib, inputs, ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.local.programs.browsers.tor-browser;
policiesJson = pkgs.callPackage ./policies.nix {
firefoxAddons = inputs.firefox-addons.packages."${pkgs.system}";
};
policiesJson = pkgs.callPackage ./policies.nix { };
torBrowser = (pkgs.tor-browser-bundle-bin.override {
mediaSupport = true;
@ -13,7 +11,6 @@ let
}).overrideAttrs (attrs: {
postInstall = ''
rm $out/share/tor-browser/distribution/policies.json
install -Dvm644 ${policiesJson} $out/share/tor-browser/distribution/policies.json
'';
});