This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

2configs: migrate syncthing and zerotier from facts to vars

- Update syncthing peer discovery to read from vars/per-machine//syncthing/syncthing.pub/value
- Update zerotier host discovery to read from vars/per-machine//zerotier/zerotier-ip/value
- Update syncthing key/cert references to use config.clan.core.vars.generators.syncthing.files paths

+14 -9
+8 -4
2configs/syncthing.nix
··· 29 29 30 30 machine_peers = lib.foldr ( 31 31 host: acc: 32 - if builtins.pathExists ../machines/${host}/facts/syncthing.pub then 32 + let 33 + syncthing_id_path = 34 + config.clan.core.clanDir + "/vars/per-machine/${host}/syncthing/syncthing.pub/value"; 35 + in 36 + if builtins.pathExists syncthing_id_path then 33 37 acc 34 38 // { 35 - ${host}.id = lib.removeSuffix "\n" (builtins.readFile ../machines/${host}/facts/syncthing.pub); 39 + ${host}.id = lib.removeSuffix "\n" (builtins.readFile syncthing_id_path); 36 40 } 37 41 else 38 42 acc ··· 55 59 enable = true; 56 60 group = "syncthing"; 57 61 configDir = "/var/lib/syncthing"; 58 - key = "${config.krebs.secret.directory}/syncthing.key"; 59 - cert = "${config.krebs.secret.directory}/syncthing.cert"; 62 + key = config.clan.core.vars.generators.syncthing.files."syncthing.key".path; 63 + cert = config.clan.core.vars.generators.syncthing.files."syncthing.cert".path; 60 64 settings.devices = used_peers; 61 65 settings.folders = lib.mapAttrs (share: devices: { 62 66 enable = lib.elem config.networking.hostName devices;
+6 -5
2configs/zerotier.nix
··· 1 - { lib, ... }: 1 + { config, lib, ... }: 2 2 let 3 3 hosts = lib.mapAttrs (machine: _: { 4 4 ip = 5 - if builtins.pathExists ../machines/${machine}/facts/zerotier-ip then 6 - builtins.readFile ../machines/${machine}/facts/zerotier-ip 7 - else 8 - null; 5 + let 6 + zerotier_ip_path = 7 + config.clan.core.clanDir + "/vars/per-machine/${machine}/zerotier/zerotier-ip/value"; 8 + in 9 + if builtins.pathExists zerotier_ip_path then builtins.readFile zerotier_ip_path else null; 9 10 }) (builtins.readDir ../machines); 10 11 11 12 filteredHosts = lib.filterAttrs (_name: host: host.ip != null) hosts;