refactor
This commit is contained in:
1 parent
81e576a877
commit
cde67e4d75
46 files changed
+619
-518
No files matched your search
@@ -14,20 +14,18 @@ let
|
||||
inherit name;
|
||||
id = machine.syncthingId;
|
||||
}
|
||||
) (lib.filterAttrs (_: machine: (machine.syncthingId or null) != null) config.facts.machines);
|
||||
) (lib.filterAttrs (_: machine: machine.syncthingId != null) config.facts.machines);
|
||||
|
||||
syncPhones = {
|
||||
"pixel-10" = {
|
||||
name = "pixel-10";
|
||||
id = "MTJHEHA-UMZDQZ7-BTMRRLQ-Y7BFPUJ-ZTY6LZX-PDXV3IS-XVJCU7B-EPETBQZ";
|
||||
};
|
||||
};
|
||||
syncExternalDevices = lib.mapAttrs (name: device: {
|
||||
inherit name;
|
||||
id = device.syncthingId;
|
||||
}) (lib.filterAttrs (_: device: device.syncthingId != null) config.facts.externalDevices);
|
||||
|
||||
syncDevices = syncMachines // syncPhones;
|
||||
syncDevices = syncMachines // syncExternalDevices;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.syncthing =
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
@@ -38,12 +36,16 @@ in
|
||||
settings = {
|
||||
folders = {
|
||||
sync = {
|
||||
path = "~/sync";
|
||||
path = "${config.home.homeDirectory}/sync";
|
||||
label = "sync";
|
||||
devices = builtins.attrNames syncDevices;
|
||||
};
|
||||
bruno = {
|
||||
path = "~/dev/bruno";
|
||||
path =
|
||||
if config.facts.machine.name == "orion" then
|
||||
"${config.home.homeDirectory}/bruno"
|
||||
else
|
||||
"${config.xdg.userDirs.projects}/bruno";
|
||||
label = "bruno";
|
||||
devices = builtins.attrNames syncDevices;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user