Skip to content

Commit 70132b9

Browse files
feat(syncthing): added syncthing configuration for lab
1 parent 5b476d3 commit 70132b9

File tree

4 files changed

+39
-9
lines changed

4 files changed

+39
-9
lines changed

configurations/nixos/lab/services/dashy.nix

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,6 @@
160160
target = "newtab";
161161
url = "http://${hostName}.home/gitweb";
162162
}
163-
{
164-
title = "syncthing";
165-
description = "syncthing file sharing";
166-
icon = "si-syncthing";
167-
target = "newtab";
168-
url = "http://${hostName}.home/gitweb";
169-
}
170163
{
171164
title = "wastebin";
172165
description = "pastebin";

configurations/nixos/lab/services/services.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ in
5252
settings = import ./samba.nix;
5353
};
5454
stirling-pdf.enable = true;
55-
syncthing.enable = true;
55+
syncthing = {
56+
enable = true;
57+
settings = import ./syncthing.nix;
58+
};
5659
vscode-server.enable = true;
5760
wastebin.enable = true;
5861
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
devices = {
3+
"mbp3" = {
4+
id = "V4NCONK-S2JLQLH-AQULXDL-Y4QQWBB-FO67NEP-G2Q2SSG-BQF4ZPW-5VHRGAY";
5+
};
6+
"penguin" = {
7+
id = "SAHKA3N-4QEINWG-OBBAHC2-53PY7JW-YMA2RZD-DZ5ONQC-OW42FON-FLCRIAM";
8+
};
9+
};
10+
folders = {
11+
"notes" = {
12+
path = "/zshare/personal/notes";
13+
devices = [
14+
"mbp3"
15+
"penguin"
16+
];
17+
versioning = {
18+
type = "simple";
19+
params.keep = "10";
20+
};
21+
type = "receiveonly";
22+
};
23+
};
24+
}

modules/nixos/services/syncthing.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
config,
33
lib,
4+
pkgs,
45
...
56
}:
67
let
@@ -18,16 +19,25 @@ in
1819
type = lib.types.port;
1920
default = 8384;
2021
};
22+
settings = lib.mkOption {
23+
inherit (pkgs.formats.json { }) type;
24+
default = { };
25+
};
2126
};
2227

2328
config = lib.mkIf cfg.enable {
2429
networking.firewall.allowedTCPPorts = [ cfg.port ];
2530

2631
services.syncthing = {
32+
inherit (cfg) settings;
33+
2734
enable = true;
2835

29-
guiAddress = "http://localhost:${toString cfg.port}";
36+
# 0.0.0.0 for debugging from web gui
37+
guiAddress = "0.0.0.0:${toString cfg.port}";
3038
openDefaultPorts = true;
39+
overrideDevices = true;
40+
overrideFolders = true;
3141
};
3242

3343
services.nginx.virtualHosts = {

0 commit comments

Comments
 (0)