refactor
This commit is contained in:
@@ -4,28 +4,17 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
syncMachines = lib.listToAttrs (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
machineName: machine:
|
||||
let
|
||||
syncthingId = machine.syncthingId or null;
|
||||
in
|
||||
lib.optional (syncthingId != null) (
|
||||
let
|
||||
name = "${config.repo.account.name}@${machineName}";
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = {
|
||||
inherit name;
|
||||
id = syncthingId;
|
||||
};
|
||||
}
|
||||
)
|
||||
) config.repo.machines
|
||||
)
|
||||
);
|
||||
account = config.facts.account;
|
||||
syncMachines = lib.mapAttrs' (
|
||||
machineName: machine:
|
||||
let
|
||||
name = "${account.name}@${machineName}";
|
||||
in
|
||||
lib.nameValuePair name {
|
||||
inherit name;
|
||||
id = machine.syncthingId;
|
||||
}
|
||||
) (lib.filterAttrs (_: machine: (machine.syncthingId or null) != null) config.facts.machines);
|
||||
|
||||
syncPhones = {
|
||||
"pixel-10" = {
|
||||
|
||||
Reference in New Issue
Block a user