Skip to content

Commit fef2b0e

Browse files
committed
Add syncthing service
The itxs host now has a syncthing service running to sync backups and documents to the backup dir.
1 parent d9ea977 commit fef2b0e

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

hosts/itxserver/configuration.nix

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ in
2222
inputs.sops-nix.nixosModules.sops
2323
];
2424

25+
sops = {
26+
defaultSopsFormat = "dotenv";
27+
age.keyFile = "/home/lukas/.config/sops/age/keys.txt";
28+
secrets.syncthing-user = {
29+
sopsFile = ../../secrets/syncthing.env.enc;
30+
key = "user";
31+
};
32+
secrets.syncthing-password = {
33+
sopsFile = ../../secrets/syncthing.env.enc;
34+
key = "password";
35+
};
36+
};
37+
2538
nix.settings.experimental-features = [
2639
"nix-command"
2740
"flakes"
@@ -75,8 +88,13 @@ in
7588
8123
7689
8888
7790
32400
91+
8384 # Syncthing web GUI
92+
22000 # Syncthing traffic
93+
];
94+
allowedUDPPorts = [
95+
22000 # Syncthing traffic
96+
21027 # Syncthing discovery
7897
];
79-
allowedUDPPorts = [ ];
8098
};
8199
search = [ "tabby-crocodile.ts.net" ];
82100
};
@@ -95,6 +113,7 @@ in
95113
git
96114
gnumake
97115
nixfmt-rfc-style
116+
sops
98117
tailscale
99118
tree
100119
vim
@@ -121,6 +140,37 @@ in
121140
};
122141
envfs.enable = true;
123142
tailscale.enable = true;
143+
syncthing = {
144+
enable = true;
145+
group = "syncthing";
146+
user = "lukas";
147+
dataDir = "/home/lukas/sync";
148+
configDir = "/home/lukas/.config/syncthing";
149+
overrideDevices = true;
150+
overrideFolders = true;
151+
settings = {
152+
gui = {
153+
user = config.sops.secrets.syncthing-user;
154+
password = config.sops.secrets.syncthing-password;
155+
address = "0.0.0.0:8384";
156+
};
157+
devices = {
158+
"MacBook-Pro" = {
159+
id = "GZAKPGB-BBVIY5T-2D3EY22-YYMGT5L-R3MNHGX-GYWNRWR-TG4BUMW-BQMBBAU";
160+
};
161+
};
162+
folders = {
163+
"Mobile Backups" = {
164+
path = "/data/backups/lukas/phone";
165+
devices = [ "MacBook-Pro" ];
166+
};
167+
"Documents" = {
168+
path = "/data/backups/lukas/documents";
169+
devices = [ "MacBook-Pro" ];
170+
};
171+
};
172+
};
173+
};
124174
};
125175

126176
programs = {

secrets/syncthing.env.enc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
user=ENC[AES256_GCM,data:gMoBHdI=,iv:hgG/nTMAbh2TM5epIvF2puoElXGUs3lOHvDoEQgS6cs=,tag:exQwpmfrVEb3A8UIBe+OSg==,type:str]
2+
password=ENC[AES256_GCM,data:5RPTMjvzJSvstU4VuQZyBtzmQZoBYM+3CaR4ABNlfUU=,iv:Yl5MyivftN52TRQei+knP3KsoFfhgN/vj+pD3sz5ogM=,tag:7r+aY6b+3ffeQH1aFCW/wg==,type:str]
3+
sops_age__list_0__map_enc=-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBtMmEyWURYWWl4Tk5sV09H\nd01SU2xTQUN3a2MyZnhSUC9xRHYwWXVaanhrCmZEeElFMmFsY0ljamtrdG92RENW\nVHVMU3ArME9vWHZCT1I2dkNLaTYwQ1EKLS0tIEpDNzlPNjVHWmFJU3cyZVpDcUE1\nbjdqRGppcG5iSWRJME8xR0M3dDVlNkkKtvvRYeui4b/RgAzjQpElOX33lX2M7V15\ndTgWKHAiSVE2Ta+HcU4BfDFj/fb+f5kipw1ETv59rDVWsGJDpOA3ew==\n-----END AGE ENCRYPTED FILE-----\n
4+
sops_age__list_0__map_recipient=age1njkfdv4ayqlqak76az6ezhse8hn3gmgt9ntur2edyz3watx2xdqq3jklqm
5+
sops_lastmodified=2025-07-03T18:19:00Z
6+
sops_mac=ENC[AES256_GCM,data:XHl+3pEk0be2WlHMv7zOxgXFE8WeVTuKjIwiJjdxczL6qfEFtC9OH5yi4YnfGu5CKdwfqc7c57yRksVGwDgIlzLk3ZErlNWY5gP1R1V+Rg/xstMRibvg7HG1hHV76oPtV6Fht5MLz6tJIba7AVHK7t+37qJm8k10NsRF20sdS1I=,iv:ionftZtVoEKdv8iXu1M7D5qOgPcu+WN4dvj/YHqO7tk=,tag:KOeGqhCSN+TMGcUb4vU0ig==,type:str]
7+
sops_unencrypted_suffix=_unencrypted
8+
sops_version=3.10.2

users/lukas.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
extraGroups = [
77
"wheel"
88
"docker"
9+
"syncthing"
910
];
1011
shell = pkgs.zsh;
1112
packages = with pkgs; [
@@ -20,6 +21,7 @@
2021
python3
2122
starship
2223
syncthing
24+
tmux
2325
tree
2426
usbutils
2527
wget

0 commit comments

Comments
 (0)