Files
lux/modules/capabilities/syncthing.nix
T
kiri 5dd1d2b296 feat: align workspace navigation with relocated projects
Use ~/yookr/projects for company repositories and ~/projects for personal groups. Add the company-root Walker entry, apply work Git identity below ~/yookr, and remove Bruno synchronization.

Filesystem relocation was previously completed on Zenith only; other hosts require their own relocation before adopting these shared paths.
2026-09-09 17:32:08 +02:00

50 lines
1.1 KiB
Nix

{
config,
lib,
...
}:
let
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 != null) config.facts.machines);
syncExternalDevices = lib.mapAttrs (name: device: {
inherit name;
id = device.syncthingId;
}) (lib.filterAttrs (_: device: device.syncthingId != null) config.facts.externalDevices);
syncDevices = syncMachines // syncExternalDevices;
in
{
flake.modules.homeManager.syncthing =
{ config, ... }:
{
services.syncthing = {
enable = true;
overrideDevices = true;
overrideFolders = true;
settings = {
folders = {
sync = {
path = "${config.home.homeDirectory}/sync";
label = "sync";
devices = builtins.attrNames syncDevices;
ignorePatterns = [ "**/.zk" ];
};
};
devices = syncDevices;
};
};
};
}