syncthing: add id option

This commit is contained in:
lassulus 2019-04-07 18:21:18 +02:00
parent e56e7fbe71
commit 212e7f4b98

View File

@ -11,8 +11,7 @@ let
}) cfg.peers; }) cfg.peers;
folders = map (folder: { folders = map (folder: {
inherit (folder) path type; inherit (folder) path id type;
id = folder.path;
devices = map (peer: { deviceId = cfg.peers.${peer}.id; }) folder.peers; devices = map (peer: { deviceId = cfg.peers.${peer}.id; }) folder.peers;
rescanIntervalS = folder.rescanInterval; rescanIntervalS = folder.rescanInterval;
fsWatcherEnabled = folder.watch; fsWatcherEnabled = folder.watch;
@ -83,13 +82,18 @@ in
folders = mkOption { folders = mkOption {
default = []; default = [];
type = types.listOf (types.submodule ({ type = types.listOf (types.submodule ({ config, ... }: {
options = { options = {
path = mkOption { path = mkOption {
type = types.absolute-pathname; type = types.absolute-pathname;
}; };
id = mkOption {
type = types.str;
default = config.path;
};
peers = mkOption { peers = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [];