diff options
| author | Joe Mou <dev@mou.fo> | 2023-09-27 16:23:48 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2023-09-28 00:31:45 -0400 |
| commit | c19346276c07394cb5fbce0794a783c67aed584d (patch) | |
| tree | d83ca336736f127077bca3517a3122e276ad3433 /hostnix/weebnix | |
| parent | 45b950159491102bccfd2adb7717df469820578c (diff) | |
Initial Syncthing module
Diffstat (limited to 'hostnix/weebnix')
| -rw-r--r-- | hostnix/weebnix/configuration.nix | 8 | ||||
| -rw-r--r-- | hostnix/weebnix/syncthing.nix | 30 |
2 files changed, 34 insertions, 4 deletions
diff --git a/hostnix/weebnix/configuration.nix b/hostnix/weebnix/configuration.nix index b36b6e4..f585f2a 100644 --- a/hostnix/weebnix/configuration.nix +++ b/hostnix/weebnix/configuration.nix @@ -5,10 +5,10 @@ { config, pkgs, ... }: { - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; + imports = [ + ./hardware-configuration.nix + ./syncthing.nix + ]; nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.trusted-users = [ "joe" ]; diff --git a/hostnix/weebnix/syncthing.nix b/hostnix/weebnix/syncthing.nix new file mode 100644 index 0000000..8fca87b --- /dev/null +++ b/hostnix/weebnix/syncthing.nix @@ -0,0 +1,30 @@ +{ ... }: + +{ + services.syncthing = { + enable = true; + devices = { + "sparky" = { + id = "FE43LDI-33WS467-LIGFWCC-5PPSKN6-GYODEWJ-KLQZLN7-H3GYGLG-IJ2JGQW"; + autoAcceptFolders = true; + }; + }; + folders = { + "Sync" = { + id = "7thks-5badk"; + path = "/var/lib/syncthing/Sync"; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "31536000"; + }; + }; + devices = [ "sparky" ]; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 22000 ]; + networking.firewall.allowedUDPPorts = [ 21027 22000 ]; +} |
