syncthing: listOf -> attrsOf
This commit is contained in:
parent
e4744b7237
commit
3adcf3a74c
|
@ -10,7 +10,7 @@ let
|
||||||
addresses = peer.addresses;
|
addresses = peer.addresses;
|
||||||
}) cfg.peers;
|
}) cfg.peers;
|
||||||
|
|
||||||
folders = map (folder: {
|
folders = mapAttrsToList ( _: folder: {
|
||||||
inherit (folder) path id type;
|
inherit (folder) path id type;
|
||||||
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;
|
||||||
|
@ -81,17 +81,18 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
folders = mkOption {
|
folders = mkOption {
|
||||||
default = [];
|
default = {};
|
||||||
type = types.listOf (types.submodule ({ config, ... }: {
|
type = types.attrsOf (types.submodule ({ config, ... }: {
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
path = mkOption {
|
path = mkOption {
|
||||||
type = types.absolute-pathname;
|
type = types.absolute-pathname;
|
||||||
|
default = config._module.args.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
id = mkOption {
|
id = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = config.path;
|
default = config._module.args.name;
|
||||||
};
|
};
|
||||||
|
|
||||||
peers = mkOption {
|
peers = mkOption {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user