searx: refactor a bit
This commit is contained in:
parent
7e932ca4e2
commit
f0b34fe8ff
|
@ -21,7 +21,7 @@ in
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = "
|
description = "
|
||||||
Whether to enable the Searx server.
|
Whether to enable the Searx server. See https://github.com/asciimoo/searx
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,15 +59,14 @@ in
|
||||||
description = "Searx server, the meta search engine.";
|
description = "Searx server, the meta search engine.";
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig.User = "searx";
|
serviceConfig = {
|
||||||
script = ''
|
User = "searx";
|
||||||
if [ -z "${configFile}" ]; then
|
ExecStart = "${pkgs.pythonPackages.searx}/bin/searx-run";
|
||||||
exec ${pkgs.pythonPackages.searx}/bin/searx-run
|
};
|
||||||
else
|
} // (optionalAttrs (configFile != "") {
|
||||||
SEARX_SETTINGS_PATH="${configFile}" exec ${pkgs.pythonPackages.searx}/bin/searx-run
|
environment.SEARX_SETTINGS_PATH = configFile;
|
||||||
fi
|
});
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.pythonPackages.searx ];
|
environment.systemPackages = [ pkgs.pythonPackages.searx ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue