nixos/searx: reformat tests with nixfmt-rfc-style

This commit is contained in:
Pol Dellaiera 2024-06-19 07:04:46 +02:00
parent 931b1bb0f1
commit da9d79d6bc
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -7,7 +7,9 @@
}; };
# basic setup: searx running the built-in webserver # basic setup: searx running the built-in webserver
nodes.base = { ... }: { nodes.base =
{ ... }:
{
services.searx = { services.searx = {
enable = true; enable = true;
environmentFile = pkgs.writeText "secrets" '' environmentFile = pkgs.writeText "secrets" ''
@ -15,17 +17,19 @@
SEARX_SECRET_KEY = somesecret SEARX_SECRET_KEY = somesecret
''; '';
settings.server = settings.server = {
{ port = "8080"; port = "8080";
bind_address = "0.0.0.0"; bind_address = "0.0.0.0";
secret_key = "@SEARX_SECRET_KEY@"; secret_key = "@SEARX_SECRET_KEY@";
}; };
settings.engines = [ settings.engines = [
{ name = "wolframalpha"; {
name = "wolframalpha";
api_key = "@WOLFRAM_API_KEY@"; api_key = "@WOLFRAM_API_KEY@";
engine = "wolframalpha_api"; engine = "wolframalpha_api";
} }
{ name = "startpage"; {
name = "startpage";
shortcut = "start"; shortcut = "start";
} }
]; ];
@ -34,7 +38,9 @@
}; };
# fancy setup: run in uWSGI and use nginx as proxy # fancy setup: run in uWSGI and use nginx as proxy
nodes.fancy = { config, ... }: { nodes.fancy =
{ config, ... }:
{
services.searx = { services.searx = {
enable = true; enable = true;
# searx refuses to run if unchanged # searx refuses to run if unchanged
@ -56,8 +62,7 @@
# use nginx as reverse proxy # use nginx as reverse proxy
services.nginx.enable = true; services.nginx.enable = true;
services.nginx.virtualHosts.localhost = { services.nginx.virtualHosts.localhost = {
locations."/searx".extraConfig = locations."/searx".extraConfig = ''
''
include ${pkgs.nginx}/conf/uwsgi_params; include ${pkgs.nginx}/conf/uwsgi_params;
uwsgi_pass unix:/run/searx/uwsgi.sock; uwsgi_pass unix:/run/searx/uwsgi.sock;
''; '';
@ -69,8 +74,7 @@
}; };
testScript = testScript = ''
''
base.start() base.start()
with subtest("Settings have been merged"): with subtest("Settings have been merged"):