Set up Syncthing

This commit is contained in:
coolneng 2019-11-07 14:25:27 +01:00
parent e46f4088c0
commit de36958760
4 changed files with 61 additions and 10 deletions

View File

@ -29,8 +29,15 @@
- [ ] VPN setup - [ ] VPN setup
*** TODO Wireguard [0/1] [0%] *** TODO Wireguard [0/1] [0%]
- [ ] Encrypted DNS - [ ] Encrypted DNS
** LEMP stack [0/8] [0%] ** Data sync [0/2] [0%]
*** TODO Nginx *** IN-PROGRESS Syncthing [0/3] [0%]
- [ ] Basic configuration
- [ ] Relay server
- [ ] Discovery server
*** TODO Radicale
** Web stack [0/7] [0%]
*** TODO Nginx [0/1] [0%]
- [ ] Radicale reverse proxy
*** TODO PHP [0/1] [0%] *** TODO PHP [0/1] [0%]
- [ ] Php-fpm - [ ] Php-fpm
*** TODO PostgreSQL [0/1] [0%] *** TODO PostgreSQL [0/1] [0%]
@ -38,18 +45,13 @@
*** TODO Certbot [0/2] [0%] *** TODO Certbot [0/2] [0%]
- [ ] Obtain certs - [ ] Obtain certs
- [ ] Script to renew certs - [ ] Script to renew certs
*** TODO Syncthing [0/2] [0%]
- [ ] Relay server
- [ ] Discovery server
*** TODO Radicale
*** TODO Wallabag *** TODO Wallabag
*** TODO Miniflux *** TODO Miniflux
*** TODO Hugo [0/2] [0%] *** TODO Hugo [0/2] [0%]
- [ ] Blog website - [ ] Blog website
- [ ] Ox-hugo - [ ] Ox-hugo
** Software development [0/2] [0%] ** Software development [0/2] [0%]
*** TODO Git [0/2] [0%] *** TODO Gitea [0/1] [0%]
- [ ] Gitea
- [ ] Import existing repositories - [ ] Import existing repositories
*** TODO Drone *** TODO Drone
** Backup [0/2] [0%] ** Backup [0/2] [0%]
@ -64,7 +66,7 @@
** Workflow [0/1] [0%] ** Workflow [0/1] [0%]
*** TODO Automate nix files deployment [0/2] [0%] *** TODO Automate nix files deployment [0/2] [0%]
- [ ] Send local file to Zion - [ ] Send local file to Zion
- [ ] Rebuild - [ ] Hook to rebuild
** Communication [0/2] [0%] ** Communication [0/2] [0%]
*** TODO Matrix *** TODO Matrix
*** TODO Mail [0/1] [0%] *** TODO Mail [0/1] [0%]

View File

@ -89,6 +89,12 @@
}; };
}; };
# Run Nix garbage collector daily
nix.gc = {
automatic = true;
dates = "03:15";
};
# Configure fish shell # Configure fish shell
#programs.fish.enable = true; #programs.fish.enable = true;
@ -99,6 +105,7 @@
imports = [ imports = [
./modules/printing.nix ./modules/printing.nix
./modules/networking.nix ./modules/networking.nix
./modules/datasync.nix
]; ];
} }

42
modules/datasync.nix Normal file
View File

@ -0,0 +1,42 @@
# Syncthing and Radicale configuration
{ config, pkgs, lib, ... }:
{
environment.systemPackages = with pkgs; [
syncthing
syncthing-relay
syncthing-discovery
radicale
];
# Enable Syncthing
services.syncthing = {
enable = true;
openDefaultPorts = true;
guiAddress = "0.0.0.0:8384";
dataDir = "/vault/syncthing";
declarative = {
devices = {
monolith = { id = "QGDGEZQ-INE7XDY-DNX2QI4-QI7ANQJ-57REEO2-FUMH545-FZS5RYU-ULF7HA2"; };
};
#cert = "";
#key = "";
folders = {};
};
#relay = {
#enable = true;
#pools = "";
#};
};
# Enable Radicale
services.radicale = {
enable = true;
config = ''
'';
};
}

View File

@ -32,7 +32,7 @@
# Firewall configuration # Firewall configuration
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 631 6566 ]; allowedTCPPorts = [ 631 6566 22067 8384 ];
autoLoadConntrackHelpers = true; autoLoadConntrackHelpers = true;
connectionTrackingModules = [ "sane" ]; connectionTrackingModules = [ "sane" ];
}; };