mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 17:45:12 -05:00
feat: added host logic for searx
This commit is contained in:
parent
7e98c1daa2
commit
f33a8eb669
2 changed files with 18 additions and 8 deletions
|
@ -1,8 +1,9 @@
|
|||
{ flake, ... }:
|
||||
{ flake, osConfig, ... }:
|
||||
let
|
||||
inherit (flake.config.services)
|
||||
instances
|
||||
;
|
||||
inherit (flake.config.services) instances;
|
||||
inherit (flake.config.machines) devices;
|
||||
localhost = instances.web.localhost.address0;
|
||||
hostname = osConfig.networking.hostName;
|
||||
in
|
||||
{
|
||||
"${instances.jellyfin.label}" = {
|
||||
|
@ -34,7 +35,14 @@ in
|
|||
icon = ./icons/sx.png;
|
||||
urls = [
|
||||
{
|
||||
template = "https://${instances.searx.subdomain}.${instances.web.domains.url0}/search?q={searchTerms}";
|
||||
template =
|
||||
(
|
||||
if hostname == devices.mars.name then
|
||||
"http://${localhost}:${toString instances.searx.ports.port0}"
|
||||
else
|
||||
"https://${instances.searx.subdomain}.${instances.web.domains.url0}"
|
||||
)
|
||||
+ "/search?q={searchTerms}";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ flake, ... }:
|
||||
{ flake, osConfig, ... }:
|
||||
let
|
||||
configPath = ./config;
|
||||
flakedPath = configPath + /flake;
|
||||
|
@ -21,6 +21,7 @@ let
|
|||
// (import (flakedPath + "/${searchEngine}") {
|
||||
inherit
|
||||
flake
|
||||
osConfig
|
||||
;
|
||||
})
|
||||
) { } (builtins.filter (name: builtins.match ".*\\.nix$" name != null) files);
|
||||
|
@ -30,20 +31,21 @@ in
|
|||
{
|
||||
search = {
|
||||
force = true;
|
||||
default = "Brave";
|
||||
default = "SearXNG";
|
||||
engines = aggregatedSearchEngines;
|
||||
order = [
|
||||
"AlternativeTo"
|
||||
"Brave"
|
||||
"Core Radio"
|
||||
"Hackage"
|
||||
"Hoogle"
|
||||
"Jellyfin"
|
||||
"SearXNG"
|
||||
"Nix Home Manager"
|
||||
"Nix Options"
|
||||
"Nix Packages"
|
||||
"Nix Wiki"
|
||||
"PeerTube"
|
||||
"SearXNG"
|
||||
"Sci-Hub"
|
||||
"Torrent Leech"
|
||||
"Urban Dictionary"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue