diff --git a/nixos/modules/services/networking/searx.nix b/nixos/modules/services/networking/searx.nix index 5a38da1e059c..dc31c10c9874 100644 --- a/nixos/modules/services/networking/searx.nix +++ b/nixos/modules/services/networking/searx.nix @@ -142,19 +142,19 @@ in ''; }; - settingsFile = mkOption { + settingsPath = mkOption { type = types.path; - default = "${runDir}/settings.yml"; + default = runDir; description = '' - The path of the Searx server settings.yml file. - If no file is specified, a default file is used (default config file has debug mode enabled). + The path of the SearXNG settings directory or the settings.yml file. + If no path is specified, a default one is used (default config file has debug mode enabled). ::: {.note} Setting this options overrides [](#opt-services.searx.settings). ::: ::: {.warning} - This file, along with any secret key it contains, will be copied into the world-readable Nix store. + This path, along with any secret keys it contains, will be copied into the world-readable Nix store. ::: ''; }; @@ -263,6 +263,7 @@ in }; imports = [ + (mkRenamedOptionModule [ "services" "searx" "settingsFile" ] [ "services" "searx" "settingsPath" ]) (mkRenamedOptionModule [ "services" "searx" "configFile" ] [ "services" "searx" "settingsFile" ]) (mkRenamedOptionModule [ "services" "searx" "runInUwsgi" ] [ "services" "searx" "configureUwsgi" ]) ]; @@ -339,7 +340,7 @@ in enable-threads = true; module = "searx.webapp"; env = [ - "SEARXNG_SETTINGS_PATH=${cfg.settingsFile}" + "SEARXNG_SETTINGS_PATH=${cfg.settingsPath}" ]; buffer-size = 32768; pythonPackages = _: [ cfg.package ]; @@ -390,7 +391,7 @@ in EnvironmentFile = cfg.environmentFile; }; environment = { - SEARXNG_SETTINGS_PATH = cfg.settingsFile; + SEARXNG_SETTINGS_PATH = cfg.settingsPath; }; }; @@ -399,7 +400,7 @@ in after = [ "searx-init.service" ]; restartTriggers = [ cfg.package - cfg.settingsFile + cfg.settingsPath ] ++ lib.optional (cfg.environmentFile != null) cfg.environmentFile; };