Personal-use NixOS configuration

Drop searx entirely

+1 -551
-35
hosts/index/config/web/searx.nix
··· 1 - { flakeRoot, ... }: 2 - 3 - let 4 - host = "search.encrypted.group"; 5 - 6 - searxModule = import (flakeRoot + /packages/server/web/searx.nix) { 7 - hosts = [ 8 - { 9 - name = host; 10 - ssl = "cloudflare"; 11 - } 12 - ]; 13 - }; 14 - in 15 - { 16 - imports = [ 17 - searxModule 18 - ]; 19 - 20 - services.searx = { 21 - environmentFile = "/mnt/apps/searx/searx.env"; 22 - 23 - settings = { 24 - general = { 25 - instance_name = "encrypted group search"; 26 - }; 27 - 28 - server = { 29 - base_url = "https://${host}"; 30 - 31 - secret_key = "@SEARXNG_SECRET@"; 32 - }; 33 - }; 34 - }; 35 - }
+1 -1
hosts/index/default.nix
··· 47 47 ./config/web/forgejo.nix 48 48 ./config/web/linkwarden.nix 49 49 ./config/web/miniflux.nix 50 - ./config/web/network-optimization.nix 50 + ./config/web/network-optimizer.nix 51 51 ./config/web/vaultwarden.nix 52 52 #./config/web/wakapi.nix 53 53
-515
packages/server/web/searx.nix
··· 1 - { 2 - hosts ? [ ], 3 - }: 4 - 5 - { 6 - config, 7 - lib, 8 - flakeLib, 9 - ... 10 - }: 11 - 12 - { 13 - services.searx = { 14 - enable = true; 15 - 16 - redisCreateLocally = true; 17 - 18 - configureUwsgi = true; 19 - uwsgiConfig = { 20 - socket = "/run/searx/searx.sock"; 21 - http = ":8888"; 22 - chmod-socket = "660"; 23 - }; 24 - 25 - settings = { 26 - general = { 27 - donation_url = false; 28 - contact_url = false; 29 - enable_metrics = false; 30 - }; 31 - 32 - ui = { 33 - center_alignment = true; 34 - infinite_scroll = true; 35 - 36 - cache_url = "https://archive.today/"; 37 - 38 - static_use_hash = true; 39 - query_in_title = false; 40 - }; 41 - 42 - search = { 43 - autocomplete = "duckduckgo"; 44 - favicon_resolver = "allesedv"; 45 - 46 - formats = [ 47 - "html" 48 - "json" 49 - ]; 50 - }; 51 - 52 - server = { 53 - public_instance = true; 54 - limiter = true; 55 - 56 - image_proxy = true; 57 - 58 - method = "GET"; 59 - 60 - bind_address = "127.0.0.1"; 61 - }; 62 - 63 - limiterSettings = { 64 - real_ip = { 65 - x_for = 1; 66 - }; 67 - 68 - botdetection = { 69 - ip_limit = { 70 - filter_link_local = true; 71 - link_token = false; 72 - }; 73 - }; 74 - }; 75 - 76 - engines = lib.mapAttrsToList (name: value: { inherit name; } // value) { 77 - # GENERAL 78 - # translate 79 - "dictzone".disabled = true; 80 - "libretranslate".disabled = true; 81 - "lingva".disabled = true; 82 - "mozhi".disabled = true; 83 - "mymemory translated".disabled = true; 84 - 85 - # web 86 - "bing".disabled = true; 87 - "brave".disabled = false; 88 - "duckduckgo".disabled = false; 89 - "google".disabled = true; 90 - "mojeek".disabled = true; 91 - "presearch".disabled = true; 92 - "presearch videos".disabled = true; 93 - "qwant".disabled = true; 94 - "startpage".disabled = true; 95 - "wiby".disabled = true; 96 - "yahoo".disabled = true; 97 - "seznam (CZ)".disabled = true; 98 - "goo (JA)".disabled = true; 99 - "naver (KO)".disabled = true; 100 - 101 - # wikimedia 102 - "wikibooks".disabled = true; 103 - "wikiquote".disabled = true; 104 - "wikisource".disabled = true; 105 - "wikispecies".disabled = true; 106 - "wikiversity".disabled = true; 107 - "wikivoyage".disabled = true; 108 - 109 - # custom 110 - "modrinth" = { 111 - disabled = true; 112 - categories = [ "general" ]; 113 - shortcut = "mr"; 114 - 115 - engine = "json_engine"; 116 - 117 - search_url = "https://api.modrinth.com/v2/search?query={query}&offset={pageno}&limit=1&index=relevance&facets=%5B%5B%22downloads%20%3E=%20500%22%5D%5D"; 118 - paging = true; 119 - page_size = 1; 120 - first_page_num = 0; 121 - 122 - results_query = "hits"; 123 - title_query = "title"; 124 - content_query = "description"; 125 - thumbnail_query = "featured_gallery"; 126 - url_query = "project_id"; 127 - url_prefix = "https://modrinth.com/project/"; 128 - 129 - weight = 1; 130 - }; 131 - 132 - # without further subgrouping 133 - "ask".disabled = true; 134 - "cloudflareai".disabled = true; 135 - "crowdview".disabled = true; 136 - "curlie".disabled = true; 137 - "currency".disabled = false; 138 - "ddg definitions".disabled = true; 139 - "encyclosearch".disabled = true; 140 - "mwmbl".disabled = true; 141 - "right dao".disabled = true; 142 - "searchmysite".disabled = true; 143 - "stract".disabled = true; 144 - "tineye".disabled = false; 145 - "wikidata".disabled = true; 146 - "wikipedia" = { 147 - disabled = false; 148 - 149 - timeout = 1.0; 150 - weight = 2; 151 - }; 152 - "wolframalpha".disabled = true; 153 - "yacy".disabled = true; 154 - "yep".disabled = true; 155 - "bpb (DE)".disabled = true; 156 - "tagesschau (DE)".disabled = true; 157 - "wikimini (FR)".disabled = true; 158 - 159 - # IMAGES 160 - # web 161 - "bing images".disabled = true; 162 - "brave.images".disabled = true; 163 - "duckduckgo images".disabled = true; 164 - "google images".disabled = false; 165 - "mojeek images".disabled = true; 166 - "presearch images".disabled = true; 167 - "qwant images".disabled = true; 168 - 169 - # without further subgrouping 170 - "1x".disabled = true; 171 - "adobe stock".disabled = true; 172 - "artic".disabled = true; 173 - "deviantart" = { 174 - disabled = false; 175 - 176 - weight = 0.2; 177 - }; 178 - "findthatmeme".disabled = true; 179 - "flickr".disabled = true; 180 - "frinkiac".disabled = true; 181 - "imgur" = { 182 - disabled = false; 183 - 184 - weight = 0.2; 185 - }; 186 - "library of congress".disabled = true; 187 - "material icons".disabled = true; 188 - "openverse" = { 189 - disabled = false; 190 - 191 - weight = 0.5; 192 - }; 193 - "pinterest".disabled = true; 194 - "svgrepo".disabled = true; 195 - "unsplash" = { 196 - disabled = false; 197 - 198 - weight = 0.5; 199 - }; 200 - "wallhaven".disabled = true; 201 - "wikicommons.images" = { 202 - disabled = false; 203 - 204 - weight = 2; 205 - }; 206 - "yacy images".disabled = true; 207 - "yep images".disabled = true; 208 - "seekr images (EN)".disabled = true; 209 - 210 - # VIDEOS 211 - # web 212 - "bing videos".disabled = false; 213 - "brave.videos".disabled = true; 214 - "duckduckgo videos".disabled = true; 215 - "google videos".disabled = true; 216 - "qwant videos".disabled = true; 217 - 218 - # without further subgrouping 219 - "adobe stock video".disabled = true; 220 - "bilibili" = { 221 - disabled = false; 222 - 223 - weight = 0.2; 224 - }; 225 - "dailymotion".disabled = true; 226 - "google play movies".disabled = true; 227 - "invidious".disabled = true; 228 - "livespace".disabled = true; 229 - "media.ccc.de".disabled = true; 230 - "odysee".disabled = false; 231 - "peertube".disabled = true; 232 - "piped".disabled = true; 233 - "rumble".disabled = true; 234 - "sepiasearch".disabled = false; 235 - "vimeo" = { 236 - disabled = false; 237 - 238 - weight = 0.5; 239 - }; 240 - "wikicommons.videos" = { 241 - disabled = false; 242 - 243 - weight = 2; 244 - }; 245 - "youtube".disabled = false; 246 - "mediathekviewweb (DE)".disabled = true; 247 - "seekr videos (EN)".disabled = true; 248 - "ina (FR)".disabled = true; 249 - 250 - # NEWS 251 - # web 252 - "duckduckgo news".disabled = true; 253 - "mojeek news".disabled = false; 254 - 255 - # wikimedia 256 - "wikinews" = { 257 - disabled = false; 258 - 259 - weight = 2; 260 - }; 261 - 262 - # without further subgrouping 263 - "bing news".disabled = true; 264 - "brave.news".disabled = true; 265 - "google news".disabled = true; 266 - "qwant news".disabled = true; 267 - "yahoo news".disabled = true; 268 - "yep news".disabled = true; 269 - "seekr news (EN)".disabled = true; 270 - 271 - # MAP 272 - "apple maps".disabled = true; 273 - "openstreetmap".disabled = false; 274 - "photon".disabled = true; 275 - 276 - # MUSIC 277 - # lyrics 278 - "genius".disabled = false; 279 - 280 - # radio 281 - "radio browser".disabled = false; 282 - 283 - # without further subgrouping 284 - "adobe stock audio".disabled = true; 285 - "bandcamp" = { 286 - disabled = false; 287 - 288 - weight = 2; 289 - }; 290 - "deezer".disabled = true; 291 - "mixcloud".disabled = true; 292 - "piped.music".disabled = true; 293 - "soundcloud" = { 294 - disabled = false; 295 - 296 - weight = 0.5; 297 - }; 298 - "wikicommons.audio" = { 299 - disabled = false; 300 - 301 - weight = 0.2; 302 - }; 303 - 304 - # IT 305 - # packages 306 - "alpine linux packages".disabled = true; 307 - "crates.io" = { 308 - disabled = false; 309 - 310 - weight = 0.6; 311 - }; 312 - "docker hub".disabled = true; 313 - "hex".disabled = true; 314 - "hoogle".disabled = true; 315 - "lib.rs".disabled = true; 316 - "metacpan".disabled = true; 317 - "npm" = { 318 - disabled = false; 319 - 320 - weight = 0.6; 321 - }; 322 - "packagist".disabled = true; 323 - "pkg.go.dev" = { 324 - disabled = false; 325 - 326 - weight = 0.6; 327 - }; 328 - "pub.dev" = { 329 - disabled = false; 330 - 331 - weight = 0.5; 332 - }; 333 - "pypi" = { 334 - disabled = false; 335 - 336 - weight = 0.5; 337 - }; 338 - "rubygems".disabled = true; 339 - "voidlinux".disabled = true; 340 - 341 - # q&a 342 - "askubuntu".disabled = true; 343 - "caddy.community".disabled = false; 344 - "discuss.python".disabled = true; 345 - "pi-hole.community".disabled = true; 346 - "stackoverflow".disabled = false; 347 - "superuser".disabled = false; 348 - 349 - # repos 350 - "bitbucket" = { 351 - disabled = false; 352 - 353 - weight = 0.7; 354 - }; 355 - "codeberg" = { 356 - disabled = false; 357 - 358 - weight = 0.8; 359 - }; 360 - "gitea.com" = { 361 - disabled = false; 362 - 363 - weight = 0.8; 364 - }; 365 - "github" = { 366 - disabled = false; 367 - 368 - weight = 0.8; 369 - }; 370 - "gitlab" = { 371 - disabled = false; 372 - 373 - weight = 0.7; 374 - }; 375 - "sourcehut" = { 376 - disabled = false; 377 - 378 - weight = 0.7; 379 - }; 380 - 381 - # software wikis 382 - "arch linux wiki".disabled = false; 383 - "free software directory".disabled = true; 384 - "gentoo".disabled = true; 385 - 386 - # without further subgrouping 387 - "anaconda".disabled = true; 388 - "cpprefrence".disabled = true; 389 - "habrahabr".disabled = true; 390 - "hackernews".disabled = false; 391 - "lobste.rs".disabled = false; 392 - "mankier" = { 393 - disabled = false; 394 - 395 - weight = 2; 396 - }; 397 - "mdn" = { 398 - disabled = false; 399 - 400 - weight = 2; 401 - }; 402 - "searchcode".disabled = true; 403 - 404 - # SCIENCE 405 - # scientific publications 406 - "arxiv".disabled = true; 407 - "crossref".disabled = true; 408 - "google scholar".disabled = false; 409 - "pubmed".disabled = false; 410 - "semanticscholar".disabled = true; 411 - 412 - # without further subgrouping 413 - "openairedatasets".disabled = true; 414 - "openairepublications".disabled = true; 415 - "pdbe".disabled = true; 416 - 417 - # FILES 418 - # apps 419 - "apk mirror".disabled = true; 420 - "apple app store".disabled = false; 421 - "fdroid".disabled = false; 422 - "google play apps" = { 423 - disabled = false; 424 - 425 - weight = 0.8; 426 - }; 427 - 428 - # without further subgrouping 429 - "1337x".disabled = true; 430 - "annas archive".disabled = true; 431 - "bt4g".disabled = true; 432 - "btdigg".disabled = true; 433 - "kickass".disabled = true; 434 - "library genesis".disabled = true; 435 - "nyaa".disabled = true; 436 - "openrepos".disabled = true; 437 - "piratebay".disabled = true; 438 - "solidtorrents".disabled = true; 439 - "tokyotoshokan".disabled = true; 440 - "wikicommons.files".disabled = false; 441 - "z-library".disabled = true; 442 - 443 - # SOCIAL MEDIA 444 - "9gag".disabled = true; 445 - "lemmy comments".disabled = false; 446 - "lemmy communities".disabled = true; 447 - "lemmy posts".disabled = false; 448 - "lemmy users".disabled = true; 449 - "mastodon hashtags".disabled = false; 450 - "mastodon users".disabled = true; 451 - "reddit" = { 452 - disabled = false; 453 - 454 - weight = 1.2; 455 - }; 456 - "tootfinder".disabled = false; 457 - 458 - # OTHER 459 - # dictionaries 460 - "etymonline".disabled = true; 461 - "wiktionary".disabled = true; 462 - "wordnik".disabled = true; 463 - "duden (DE)".disabled = true; 464 - "woxikon.de synonyme (DE)".disabled = true; 465 - "jisho (JA)".disabled = true; 466 - "sjp.pwn (PL)".disabled = true; 467 - 468 - # movies 469 - "imdb".disabled = true; 470 - "rottentomatoes".disabled = true; 471 - "tmdb".disabled = true; 472 - "moviepilot (DE)".disabled = true; 473 - 474 - # shopping 475 - "geizhals (DE)".disabled = true; 476 - 477 - # weather 478 - "duckduckgo weather".disabled = true; 479 - "openmeteo".disabled = true; 480 - "wttr.in".diasbled = true; 481 - 482 - # without further subgrouping 483 - "emojipedia".disabled = true; 484 - "erowid".disabled = true; 485 - "fyyd".disabled = true; 486 - "goodreads".disabled = true; 487 - "openlibrary".disabled = true; 488 - "podcastindex".disabled = true; 489 - "yummly".disabled = true; 490 - "chefkoch (DE)".disabled = true; 491 - "destatis (DE)".disabled = true; 492 - }; 493 - 494 - enabled_plugins = [ 495 - "Unit converter plugin" 496 - "Self Information" 497 - "Hash plugin" 498 - "Open Access DOI rewrite" 499 - "Tracker URL remover" 500 - ]; 501 - }; 502 - }; 503 - 504 - # Caddy reverse proxy configuration 505 - users.users.caddy.extraGroups = [ config.users.users.searx.group ]; 506 - 507 - services.caddy.virtualHosts = flakeLib.mkProxies hosts '' 508 - reverse_proxy unix/${config.services.searx.uwsgiConfig.socket} { 509 - transport uwsgi 510 - 511 - header_up X-Forwarded-For {http.request.header.CF-Connecting-IP} 512 - header_up X-Real-IP {http.request.header.CF-Connecting-IP} 513 - } 514 - ''; 515 - }