Add Vanguard back to syncthing

This commit is contained in:
Evie Litherland-Smith 2023-08-30 07:28:36 +01:00
parent 277cc638f1
commit 09e52ee595
5 changed files with 50 additions and 46 deletions

View file

@ -2,11 +2,9 @@
build:
sudo nixos-rebuild build --flake .
-nix run nixpkgs#home-manager -- build --flake .
switch:
sudo nixos-rebuild switch --flake .
-nix run nixpkgs#home-manager -- switch --flake .
test:
sudo nixos-rebuild test --flake .

View file

@ -1,4 +1,5 @@
{lib, ...}: let
{ ... }:
let
# generate via openvpn --genkey --secret openvpn-laptop.key
client-key = "/root/openvpn.key";
domain = "vpn.xenia.me.uk";
@ -19,21 +20,20 @@ in {
];
services.syncthing = let
user = "xenia";
group = "users";
dataDir = "/var/lib/syncthing";
in {
user = user;
group = "users";
dataDir = dataDir;
inherit user group dataDir;
settings.folders = {
"Archive".path = lib.mkForce (dataDir + "/Archive");
"Books".path = lib.mkForce (dataDir + "/Books");
"Comics".path = lib.mkForce (dataDir + "/Comics");
"Documents".path = lib.mkForce (dataDir + "/Documents");
"Exports".path = lib.mkForce (dataDir + "/Exports");
"Notes".path = lib.mkForce (dataDir + "/Notes");
"Pictures".path = lib.mkForce (dataDir + "/Pictures");
"Tasks".path = lib.mkForce (dataDir + "/Tasks");
"Zotero".path = lib.mkForce (dataDir + "/Zotero");
"Archive".path = dataDir + "/Archive";
"Books".path = dataDir + "/Books";
"Comics".path = dataDir + "/Comics";
"Documents".path = dataDir + "/Documents";
"Exports".path = dataDir + "/Exports";
"Notes".path = dataDir + "/Notes";
"Pictures".path = dataDir + "/Pictures";
"Tasks".path = dataDir + "/Tasks";
"Zotero".path = dataDir + "/Zotero";
};
};
@ -41,11 +41,11 @@ in {
nat = {
enable = true;
externalInterface = "enp42s0";
internalInterfaces = [vpn-dev];
internalInterfaces = [ vpn-dev ];
};
firewall = {
trustedInterfaces = [vpn-dev];
allowedUDPPorts = [port];
trustedInterfaces = [ vpn-dev ];
allowedUDPPorts = [ port ];
};
};

View file

@ -1,12 +1,11 @@
{...}: let
user = "elitherl";
group = "users";
dataDir = "/home/${user}";
in {
imports = [./syncthing];
services.syncthing = {
user = user;
group = "users";
dataDir = dataDir;
inherit user group dataDir;
settings.folders = {
"Archive".enable = false;
"Books".enable = false;

View file

@ -1 +1,18 @@
{ ... }: { imports = [ ./sshd ]; }
{ ... }:
let
user = "xenia";
group = "users";
dataDir = "/home/${user}";
in {
imports = [ ./sshd ./syncthing ];
services.syncthing = {
inherit user group dataDir;
settings.folders = {
"Archive".enable = false;
"Books".enable = false;
"Comics".enable = false;
"Exports".enable = false;
"Pictures".enable = false;
};
};
}

View file

@ -1,11 +1,7 @@
{ lib, ... }:
let
defaultDataDir = "/var/lib/syncthing";
deviceGroups = {
all = [ "Ion" "Legion" "Monarch" ];
personal = [ "Legion" "Monarch" ];
work = [ "Ion" "Legion" "Monarch" "Ronin" ];
};
devices = [ "Ion" "Legion" "Monarch" "Ronin" "Vanguard" ];
in {
services.syncthing = {
enable = true;
@ -14,66 +10,60 @@ in {
openDefaultPorts = true;
settings = {
devices = {
"Ion".id =
"7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB";
"Legion".id =
"6OX54CG-EAQMXKA-K7TXB5P-G5A27HB-52JE2FA-XNAYZU6-YMIDBXP-RKPBJQV";
"Monarch".id =
"CJSUZQY-67XBLEZ-VKVHQHI-BLEUZNF-G4237AV-AW44CGH-F3JDKXU-CWT3RQZ";
# "Nortstar".id = "";
"Ronin".id =
"ZOL5YHK-ZZZULIE-UHGVKHW-H5E4BP7-S4CZBOX-OIZVUCV-RZUXOKA-QVBUBAJ";
"Vanguard".id =
"I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK";
"Ion".id = "7DD4NPH-6T2ET5A-4FCLFWW-CS6UR2W-IO5XQXC-DM5B2Q4-6X7DGU2-UKKVEAB";
"Legion".id = "6OX54CG-EAQMXKA-K7TXB5P-G5A27HB-52JE2FA-XNAYZU6-YMIDBXP-RKPBJQV";
"Monarch".id = "CJSUZQY-67XBLEZ-VKVHQHI-BLEUZNF-G4237AV-AW44CGH-F3JDKXU-CWT3RQZ";
"Ronin".id = "ZOL5YHK-ZZZULIE-UHGVKHW-H5E4BP7-S4CZBOX-OIZVUCV-RZUXOKA-QVBUBAJ";
"Vanguard".id = "I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK";
};
folders = {
"Archive" = {
inherit devices;
id = "hwnqy-xzcdx";
path = lib.mkDefault "~/Documents/Archive";
ignorePerms = true;
devices = deviceGroups.personal;
};
"Books" = {
inherit devices;
id = "zjmxy-ycmbq";
path = lib.mkDefault "~/Documents/Books";
ignorePerms = true;
devices = deviceGroups.personal;
};
"Comics" = {
inherit devices;
id = "kc2h0-q3wot";
path = lib.mkDefault "~/Documents/Comics";
ignorePerms = true;
devices = deviceGroups.personal;
};
"Documents" = {
inherit devices;
id = "qc6qa-bipsd";
path = lib.mkDefault "~/Documents/Sync";
ignorePerms = true;
devices = deviceGroups.personal;
};
"Exports" = {
inherit devices;
id = "tof2e-pdtde";
path = lib.mkDefault "~/Documents/Exports";
ignorePerms = true;
devices = deviceGroups.personal;
};
"Notes" = {
inherit devices;
id = "4ggjz-5dyop";
path = lib.mkDefault "~/Notes";
ignorePerms = true;
devices = deviceGroups.work;
};
"Pictures" = {
inherit devices;
id = "ziuj8-rm6dn";
path = lib.mkDefault "~/Pictures";
ignorePerms = true;
devices = deviceGroups.all;
};
"Zotero" = {
inherit devices;
id = "huyvn-liwc9";
path = lib.mkDefault "~/Documents/Zotero";
ignorePerms = true;
devices = deviceGroups.work;
};
};
};