From fdc776ceeac438592b7dc0b118e6f1669c96e592 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 20 Jun 2024 21:36:16 +0200 Subject: [PATCH] searxng: update config option --- nix/searxng.nix | 8 +++++++- nix/searxng_test.nix | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/nix/searxng.nix b/nix/searxng.nix index 63878741..bb4db71c 100644 --- a/nix/searxng.nix +++ b/nix/searxng.nix @@ -20,6 +20,12 @@ in type = types.port; }; + use_default_settings = lib.mkOption { + description = "Use default Searxng settings"; + default = true; + type = types.bool; + }; + settings = lib.mkOption { type = yamlFormat.type; default = { @@ -47,9 +53,9 @@ in environment = { SEARXNG_SETTINGS_PATH = "${yamlFormat.generate "settings.yaml" ( lib.recursiveUpdate config.settings { - use_default_settings = true; server.bind_address = config.host; server.port = config.port; + use_default_settings = config.use_default_settings; } )}"; }; diff --git a/nix/searxng_test.nix b/nix/searxng_test.nix index d73c920b..0c523102 100644 --- a/nix/searxng_test.nix +++ b/nix/searxng_test.nix @@ -1,6 +1,14 @@ { pkgs, ... }: { - services.searxng."searxng1".enable = true; + services.searxng."searxng1" = { + enable = true; + use_default_settings = false; + settings = { + server.secret_key = "secret"; + doi_resolvers."dummy" = "http://example.org"; + default_doi_resolver = "dummy"; + }; + }; settings.processes.test = { command = pkgs.writeShellApplication {