mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-28 01:35:06 +00:00
nix: add extraConfig option
This commit adds a new option for joex and server modules - extraConfig. Its main use-case is to specify options that are present in docspell but not (perhaps, yet) defined in the modules.
This commit is contained in:
parent
a7bc973345
commit
f5a508be8d
@ -58,6 +58,16 @@ in
|
||||
}
|
||||
];
|
||||
inherit full-text-search;
|
||||
extraConfig = {
|
||||
files = {
|
||||
default-store = "database";
|
||||
stores = {
|
||||
minio = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
|
@ -3,10 +3,12 @@ overlay: { config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.docspell-joex;
|
||||
# Extract the config without the extraConfig attribute. It will be merged later
|
||||
declared_config = attrsets.filterAttrs (n: v: n != "extraConfig") cfg;
|
||||
user = if cfg.runAs == null then "docspell" else cfg.runAs;
|
||||
configFile = pkgs.writeText "docspell-joex.conf" ''
|
||||
{"docspell": { "joex":
|
||||
${builtins.toJSON cfg}
|
||||
${builtins.toJSON (lib.recursiveUpdate declared_config cfg.extraConfig)}
|
||||
}}
|
||||
'';
|
||||
defaults = {
|
||||
@ -1670,6 +1672,23 @@ in
|
||||
default = defaults.addons;
|
||||
description = "Addon executor config";
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
description = "Extra configuration for docspell server. Overwrites values in case of a conflict.";
|
||||
default = { };
|
||||
example = ''
|
||||
{
|
||||
files = {
|
||||
default-store = "minio";
|
||||
stores = {
|
||||
minio = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -3,10 +3,12 @@ overlay: { config, lib, pkgs, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.docspell-restserver;
|
||||
# Extract the config without the extraConfig attribute. It will be merged later
|
||||
declared_config = attrsets.filterAttrs (n: v: n != "extraConfig") cfg;
|
||||
user = if cfg.runAs == null then "docspell" else cfg.runAs;
|
||||
configFile = pkgs.writeText "docspell-server.conf" ''
|
||||
{"docspell": {"server":
|
||||
${builtins.toJSON cfg}
|
||||
${builtins.toJSON (lib.recursiveUpdate declared_config cfg.extraConfig)}
|
||||
}}
|
||||
'';
|
||||
defaults = {
|
||||
@ -839,6 +841,23 @@ in
|
||||
default = defaults.backend;
|
||||
description = "Configuration for the backend";
|
||||
};
|
||||
extraConfig = mkOption {
|
||||
type = types.attrs;
|
||||
description = "Extra configuration for docspell server. Overwrites values in case of a conflict.";
|
||||
default = { };
|
||||
example = ''
|
||||
{
|
||||
files = {
|
||||
default-store = "minio";
|
||||
stores = {
|
||||
minio = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user