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 {