Skip to content

Commit

Permalink
searxng: update config option
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 20, 2024
1 parent 93466ff commit fdc776c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
8 changes: 7 additions & 1 deletion nix/searxng.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
}
)}";
};
Expand Down
10 changes: 9 additions & 1 deletion nix/searxng_test.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit fdc776c

Please sign in to comment.