improve syncthing.nix
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 10m11s

This commit is contained in:
Ingolf Wagner 2024-08-29 08:06:27 +07:00
parent 4c647291bc
commit 2bc86a4912
Signed by: palo
GPG key ID: 76BF5F1928B9618B
5 changed files with 8 additions and 45 deletions

View file

@ -1,14 +1,4 @@
{ config, lib, pkgs, factsGenerator, clanLib, ... }:
let
clanMachines =
lib.mapAttrs
(machine: facts: {
name = machine;
id = facts."syncthing.pub";
addresses = [ "tcp://[${facts."zerotier-ip"}]:22000" ];
})
(clanLib.readFactsFromAllMachines [ "syncthing.pub" "zerotier-ip" ]);
in
with lib; {
# networking.firewall.interfaces."gummybears".allowedTCPPorts = [ 8384 ];
@ -22,6 +12,14 @@ with lib; {
cert = config.clan.core.facts.services.syncthing.secret."syncthing.cert".path;
settings.devices =
let
clanMachines =
lib.mapAttrs
(machine: facts: {
name = machine;
id = facts."syncthing.pub";
addresses = [ "tcp://[${facts."zerotier-ip"}]:22000" ];
})
(clanLib.readFactsFromAllMachines [ "syncthing.pub" "zerotier-ip" ]);
device = machine: id: {
"${machine}" = {
name = machine;
@ -37,8 +35,6 @@ with lib; {
settings.folders = {
# needs to be on encrypted drives
# -------------------------------
audiobooks = {
enable = lib.mkDefault false;
path = lib.mkDefault "/tmp/audiobooks";
@ -102,16 +98,6 @@ with lib; {
path = lib.mkDefault "/tmp/password-store";
devices = [ "cream" "cherry" "orbi" ];
};
# todo remove if zfs is is used
#nextcloud_backup = {
# enable = lib.mkDefault false;
# path = lib.mkDefault "/tmp/lost-fotos";
# devices = [ "chungus" ];
# versioning = {
# type = "simple";
# params.keep = "2";
# };
#};
};
};

View file

@ -1,6 +1,5 @@
{ config, pkgs, lib, ... }: {
services.syncthing = {
enable = true;
openDefaultPorts = false;
@ -10,9 +9,6 @@
configDir = "/home/palo/.syncthing";
overrideFolders = true;
settings.folders = {
# on encrypted drive
# ------------------
oscar_cpap = {
enable = true;
path = "/home/palo/Documents/OSCAR_Data";
@ -42,9 +38,6 @@
path = "/home/palo/share";
type = "sendonly";
};
# no need to be encrypted
# -----------------------
books = {
enable = true;
path = "/home/palo/books";

View file

@ -5,10 +5,7 @@
overrideFolders = true;
user = "media";
group = "media";
# make some folders send only
settings.folders = {
# on encrypted drive
# ------------------
oscar_cpap = {
enable = true;
path = "/syncthing/oscar_cpap";

View file

@ -10,9 +10,6 @@
configDir = "/home/palo/.syncthing";
overrideFolders = true;
settings.folders = {
# on encrypted drive
# ------------------
oscar_cpap = {
enable = true;
path = "/home/palo/Documents/OSCAR_Data";
@ -25,10 +22,6 @@
enable = true;
path = "/home/palo/logseq";
};
#private = {
# enable = true;
# path = "/home/palo/private";
#};
art = {
enable = true;
path = "/home/palo/art";
@ -46,9 +39,6 @@
path = "/home/palo/share";
type = "sendonly";
};
# no need to be encrypted
# -----------------------
books = {
enable = true;
path = "/home/palo/books";

View file

@ -8,9 +8,6 @@
configDir = "/home/palo/.syncthing";
overrideFolders = true;
folders = {
# on encrypted drive
# ------------------
private = {
enable = true;
path = "/home/palo/private";