working on syncthing

This commit is contained in:
Ingolf Wagner 2024-06-05 18:37:31 +02:00
parent 7a459f998c
commit e96885e3b1
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 22 additions and 14 deletions

View file

@ -79,7 +79,6 @@ with lib;
locations."/" = {
root = pkgs.landingpage.override {
jsonConfig = [
{ title = "System Links"; }
{

View file

@ -1,25 +1,34 @@
{ config, lib, pkgs, factsGenerator, ... }:
let
machineDir = "${config.clanCore.clanDir}/machines";
syncthingPub = machine:
lib.removeSuffix "\n"
(builtins.readFile "${machineDir}/${machine}/facts/syncthing.pub");
zerotierIp = machine: (builtins.readFile "${machineDir}/${machine}/facts/zerotier-ip");
in
with lib; {
networking.firewall.interfaces."gummybears".allowedTCPPorts = [ 8384 ];
# networking.firewall.interfaces."gummybears".allowedTCPPorts = [ 8384 ];
clanCore.facts.services.syncthing = factsGenerator.syncthing { };
services.syncthing = {
#guiAddress = lib.mkDefault "${config.networking.hostName}.${config.clan.static-hosts.topLevelDomain}:8384";
#guiAddress = lib.mkDefault "[${zerotierIp config.networking.hostName}]:8384";
guiAddress = lib.mkDefault "${config.networking.hostName}.private:8384";
overrideDevices = lib.mkDefault true;
key = config.clanCore.facts.services.syncthing.secret."syncthing.key".path;
cert = config.clanCore.facts.services.syncthing.secret."syncthing.cert".path;
settings.devices =
let
machineDir = "${config.clanCore.clanDir}/machines";
syncthingPub = machine:
lib.removeSuffix "\n"
(builtins.readFile "${machineDir}/${machine}/facts/syncthing.pub");
zerotierIp = machine: (builtins.readFile "${machineDir}/${machine}/facts/zerotier-ip");
#machineDir = "${config.clanCore.clanDir}/machines";
#syncthingPub = machine:
# lib.removeSuffix "\n"
# (builtins.readFile "${machineDir}/${machine}/facts/syncthing.pub");
#zerotierIp = machine: (builtins.readFile "${machineDir}/${machine}/facts/zerotier-ip");
clanDevice = machine: {
zeroDevice = machine: {
"${machine}" = {
name = machine;
id = syncthingPub machine;
@ -43,10 +52,10 @@ with lib; {
in
{ }
// (tincDevice "orbi")
// (tincDevice "cream")
// (tincDevice "cherry")
// (tincDevice "chungus")
// (zeroDevice "orbi")
// (zeroDevice "cream")
// (zeroDevice "cherry")
// (zeroDevice "chungus")
#// (device "mobi" )
#// (device "bobi" )

View file

@ -21,7 +21,7 @@
"*.private" = {
user = "root";
};
"*.gummybear" = {
"*.bear" = {
user = "root";
};
"*.lan" = {