syncthing: made module more NixOps friendly

This commit is contained in:
Ingolf Wanger 2019-05-21 22:24:36 +02:00 committed by Lassulus
parent d35692126f
commit e4f1e144a0

View file

@ -18,7 +18,10 @@ let
fsWatcherEnabled = folder.watch;
fsWatcherDelayS = folder.watchDelay;
ignorePerms = folder.ignorePerms;
}) cfg.declarative.folders;
}) (filterAttrs (
_: folder:
folder.enable
) cfg.declarative.folders);
# get the api key by parsing the config.xml
getApiKey = pkgs.writers.writeDash "getAPIKey" ''
@ -169,6 +172,16 @@ in {
type = types.attrsOf (types.submodule ({ config, ... }: {
options = {
enable = mkOption {
type = types.bool;
default = true;
description = ''
share this folder.
This option is useful when you want to define all folders
in one place, but not every machine should share all folders.
'';
};
path = mkOption {
type = types.str;
default = config._module.args.name;