Prepare nixos setup for full-text-search and new consumedir settings

This commit is contained in:
Eike Kettner
2020-06-28 13:36:46 +02:00
parent d3b3c6289b
commit 7193279053
4 changed files with 128 additions and 6 deletions

View File

@ -45,6 +45,40 @@ in {
description = "Check for duplicates and update only if the file is not already present.";
};
integration-endpoint = mkOption {
type = types.submodule({
options = {
enabled = mkOption {
type = types.bool;
default = false;
description = "Whether to upload to the integration endpoint.";
};
header = mkOption {
type = types.str;
default = "";
description = ''
The `header:value` string matching the configured header-name
and value for the integration endpoint.
'';
};
user = mkOption {
type = types.str;
default = "";
description = ''
The `user:password` string matching the configured user and password
for the integration endpoint. Since both are separated by a colon, the
user name may not contain a colon (the password can).
'';
};
};
});
default = {
enabled = false;
header = "";
user = "";
};
description = "Settings for using the integration endpoint.";
};
urls = mkOption {
type = types.listOf types.str;
example = [ "http://localhost:7880/api/v1/open/upload/item/abced-12345-abcde-12345" ];
@ -68,6 +102,17 @@ in {
(if cfg.verbose then ["-v"] else []) ++
(if cfg.deleteFiles then ["-d"] else []) ++
(if cfg.distinct then [ "-m" ] else []) ++
(if cfg.integration-endpoint.enabled then [ "-i" ] else []) ++
(if cfg.integration-endpoint.header != ""
then
[ "--iheader" cfg.integration-endpoint.header ]
else
[]) ++
(if cfg.integration-endpoint.user != ""
then
[ "--iuser" cfg.integration-endpoint.user ]
else
[]) ++
(map (a: "'" + a + "'") cfg.urls);
cmd = "${pkgs.docspell.tools}/bin/consumedir.sh " + (builtins.concatStringsSep " " args);
in