summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2019-04-18 10:14:18 +0200
committerlassulus <lassulus@lassul.us>2019-04-18 10:14:18 +0200
commit3adcf3a74c00b5e88b8c8c15d6aeb9ab3f9304db (patch)
tree2c7ee23d09ea2a0f4d7cec427fb267929ee61fa0 /krebs
parente4744b723728293fda24fccd9180f9e0bbdd80e8 (diff)
syncthing: listOf -> attrsOf
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/syncthing.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/krebs/3modules/syncthing.nix b/krebs/3modules/syncthing.nix
index bfbac1db9..897ba1e7f 100644
--- a/krebs/3modules/syncthing.nix
+++ b/krebs/3modules/syncthing.nix
@@ -10,7 +10,7 @@ let
addresses = peer.addresses;
}) cfg.peers;
- folders = map (folder: {
+ folders = mapAttrsToList ( _: folder: {
inherit (folder) path id type;
devices = map (peer: { deviceId = cfg.peers.${peer}.id; }) folder.peers;
rescanIntervalS = folder.rescanInterval;
@@ -81,17 +81,18 @@ in
};
folders = mkOption {
- default = [];
- type = types.listOf (types.submodule ({ config, ... }: {
+ default = {};
+ type = types.attrsOf (types.submodule ({ config, ... }: {
options = {
path = mkOption {
type = types.absolute-pathname;
+ default = config._module.args.name;
};
id = mkOption {
type = types.str;
- default = config.path;
+ default = config._module.args.name;
};
peers = mkOption {