2024-10-23 15:35:05 +00:00
{ pkgs , . . . }: {
services = {
searx = {
enable = true ;
package = pkgs . searxng ;
settings = {
2024-10-23 16:03:43 +00:00
search = {
safe_search = 1 ; # 0 = None, 1 = Moderate, 2 = Strict
autocomplete = " g o o g l e " ; # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default
default_lang = " e n " ;
} ;
2024-10-23 15:35:05 +00:00
server = {
secret_key = " T O D O _ U S E _ S O P S _ I N S T E A D " ;
port = 8888 ; # Internal port
bind_address = " l o c a l h o s t " ; # Only listen locally
base_url = " h t t p s : / / s e a r c h . n e z i a . d e v / " ;
image_proxy = true ;
default_http_headers = {
X-Content-Type-Options = " n o s n i f f " ;
X-XSS-Protection = " 1 ; m o d e = b l o c k " ;
X-Download-Options = " n o o p e n " ;
X-Robots-Tag = " n o i n d e x , n o f o l l o w " ;
Referrer-Policy = " n o - r e f e r r e r " ;
} ;
} ;
engines = [
{
name = " q w a n t " ;
disabled = true ;
}
] ;
} ;
} ;
caddy = {
enable = true ;
virtualHosts . " s e a r c h . n e z i a . d e v " = {
extraConfig = ''
encode gzip
reverse_proxy localhost:8888 {
header_up Host { host }
header_up X-Real-IP { remote_addr }
header_up X-Forwarded-For { remote_addr }
header_up X-Forwarded-Proto { scheme }
}
'' ;
} ;
} ;
} ;
# Open required ports
networking . firewall = {
allowedTCPPorts = [ 80 443 ] ; # For Caddy
} ;
}