feat: add syncthing
This commit is contained in:
parent
24c63b4375
commit
3b43500a12
6 changed files with 104 additions and 11 deletions
services/syncthing
44
services/syncthing/felix-nixos.nix
Normal file
44
services/syncthing/felix-nixos.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
openDefaultPorts = true;
|
||||
user = "felschr";
|
||||
configDir = "/home/felschr/.config/syncthing";
|
||||
dataDir = "/home/felschr/.local/share/syncthing";
|
||||
declarative = {
|
||||
cert = "/etc/nixos/secrets/syncthing/cert.pem";
|
||||
key = "/etc/nixos/secrets/syncthing/key.pem";
|
||||
devices = {
|
||||
rpi4 = {
|
||||
id =
|
||||
"RBKVWQQ-TGYBMQK-P4AADKE-7LGPHL7-UY4FEZA-6N7HQ4R-UCPSZPV-LWFK4AP";
|
||||
};
|
||||
pixel3 = {
|
||||
id =
|
||||
"EUW6XKB-XWM4L2L-7Q46YGM-KD4JX3U-OFE5AAC-B3JT6QY-5YSPXXI-W7OKCQO";
|
||||
};
|
||||
};
|
||||
folders = {
|
||||
"Default" = {
|
||||
id = "default";
|
||||
path = "/home/felschr/sync/default";
|
||||
devices = [ "rpi4" "pixel3" ];
|
||||
};
|
||||
"Backups" = {
|
||||
id = "backups";
|
||||
path = "/home/felschr/sync/backups";
|
||||
type = "sendonly";
|
||||
devices = [ "rpi4" ];
|
||||
};
|
||||
"Media" = {
|
||||
id = "media";
|
||||
path = "/home/felschr/sync/media";
|
||||
type = "sendonly";
|
||||
devices = [ "rpi4" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
47
services/syncthing/rpi4.nix
Normal file
47
services/syncthing/rpi4.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
openDefaultPorts = true;
|
||||
user = "felschr";
|
||||
configDir = "/home/felschr/.config/syncthing";
|
||||
dataDir = "/home/felschr/.local/share/syncthing";
|
||||
declarative = {
|
||||
cert = "/etc/nixos/secrets/syncthing/cert.pem";
|
||||
key = "/etc/nixos/secrets/syncthing/key.pem";
|
||||
devices = {
|
||||
felix-nixos = {
|
||||
id =
|
||||
"MKVEPJK-HWGFVLN-SRHE4NR-ZADXKMF-AMYIKZ7-MGUJH3L-XH2FBOW-AMQRIAW";
|
||||
};
|
||||
pixel3 = {
|
||||
id =
|
||||
"EUW6XKB-XWM4L2L-7Q46YGM-KD4JX3U-OFE5AAC-B3JT6QY-5YSPXXI-W7OKCQO";
|
||||
};
|
||||
};
|
||||
# TODO switch to external storage
|
||||
folders = {
|
||||
"Default" = {
|
||||
id = "default";
|
||||
path = "/home/felschr/sync/default";
|
||||
devices = [ "felix-nixos" "pixel3" ];
|
||||
};
|
||||
"Backups" = {
|
||||
id = "backups";
|
||||
path = "/home/felschr/sync/backups";
|
||||
type = "receiveonly";
|
||||
ignoreDelete = true;
|
||||
devices = [ "felix-nixos" ];
|
||||
};
|
||||
"Media" = {
|
||||
id = "media";
|
||||
path = "/home/felschr/sync/media";
|
||||
type = "receiveonly";
|
||||
ignoreDelete = true;
|
||||
devices = [ "felix-nixos" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue