diff options
author | lassulus <lassulus@lassul.us> | 2019-04-18 10:14:18 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2019-04-18 10:14:18 +0200 |
commit | 3adcf3a74c00b5e88b8c8c15d6aeb9ab3f9304db (patch) | |
tree | 2c7ee23d09ea2a0f4d7cec427fb267929ee61fa0 /krebs | |
parent | e4744b723728293fda24fccd9180f9e0bbdd80e8 (diff) |
syncthing: listOf -> attrsOf
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/3modules/syncthing.nix | 9 |
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 { |