feat: add syncthing
This commit is contained in:
parent
24c63b4375
commit
3b43500a12
|
@ -8,6 +8,7 @@
|
||||||
./system
|
./system
|
||||||
./desktop
|
./desktop
|
||||||
./virtualisation/docker.nix
|
./virtualisation/docker.nix
|
||||||
|
./services/syncthing/felix-nixos.nix
|
||||||
./services/jellyfin.nix
|
./services/jellyfin.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
./desktop/monitors.nix
|
./desktop/monitors.nix
|
||||||
./vpn.nix
|
./vpn.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
|
./syncthing.nix
|
||||||
./keybase.nix
|
./keybase.nix
|
||||||
./signal.nix
|
./signal.nix
|
||||||
./browsers
|
./browsers
|
||||||
|
|
5
home/syncthing.nix
Normal file
5
home/syncthing.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.syncthing.tray = true;
|
||||||
|
}
|
17
rpi4.nix
17
rpi4.nix
|
@ -1,14 +1,14 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
with builtins;
|
with builtins; {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
# ./hardware/base.nix
|
# ./hardware/base.nix
|
||||||
# ./system
|
# ./system
|
||||||
./system/nix.nix
|
./system/nix.nix
|
||||||
./system/i18n.nix
|
./system/i18n.nix
|
||||||
./services/jellyfin.nix
|
|
||||||
./modules/cfdyndns.nix
|
./modules/cfdyndns.nix
|
||||||
|
./services/syncthing/felix-nixos.nix
|
||||||
|
./services/jellyfin.nix
|
||||||
./services/home-assistant.nix
|
./services/home-assistant.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -19,17 +19,12 @@ with builtins;
|
||||||
boot.loader.raspberryPi.enable = true;
|
boot.loader.raspberryPi.enable = true;
|
||||||
boot.loader.raspberryPi.version = 4;
|
boot.loader.raspberryPi.version = 4;
|
||||||
boot.kernelPackages = pkgs.linuxPackages_rpi4;
|
boot.kernelPackages = pkgs.linuxPackages_rpi4;
|
||||||
boot.kernelParams = [
|
boot.kernelParams = [ "console=ttyAMA0,115200" "console=tty1" ];
|
||||||
"console=ttyAMA0,115200"
|
|
||||||
"console=tty1"
|
|
||||||
];
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
networking.domain = "home.felschr.com";
|
networking.domain = "home.felschr.com";
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
80 443
|
|
||||||
];
|
|
||||||
|
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
|
@ -74,7 +69,7 @@ with builtins;
|
||||||
|
|
||||||
boot.initrd.network.ssh = {
|
boot.initrd.network.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
authorizedKeys = [(readFile "./key")];
|
authorizedKeys = [ (readFile "./key") ];
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.felschr = {
|
users.users.felschr = {
|
||||||
|
|
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…
Reference in a new issue