refactor: schema
This commit is contained in:
@@ -5,21 +5,26 @@
|
||||
}:
|
||||
let
|
||||
syncMachines = lib.listToAttrs (
|
||||
lib.concatMap (
|
||||
machine:
|
||||
lib.optional (machine.syncthingId != null) (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
machineName: machine:
|
||||
let
|
||||
name = "${config.repo.account.name}@${machine.name}";
|
||||
syncthingId = machine.syncthingId or null;
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = {
|
||||
lib.optional (syncthingId != null) (
|
||||
let
|
||||
name = "${config.repo.account.name}@${machineName}";
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
id = machine.syncthingId;
|
||||
};
|
||||
}
|
||||
)
|
||||
) (builtins.attrValues config.repo.machines)
|
||||
value = {
|
||||
inherit name;
|
||||
id = syncthingId;
|
||||
};
|
||||
}
|
||||
)
|
||||
) config.repo.machines
|
||||
)
|
||||
);
|
||||
|
||||
syncPhones = {
|
||||
|
||||
Reference in New Issue
Block a user