Set more sensible default directories for syncthing

This commit is contained in:
Evie Litherland-Smith 2023-07-21 11:38:46 +01:00
parent 28b95d7096
commit 4fdc446aec
4 changed files with 29 additions and 26 deletions

View file

@ -1,4 +1,4 @@
{...}: let {lib, ...}: let
# generate via openvpn --genkey --secret openvpn-laptop.key # generate via openvpn --genkey --secret openvpn-laptop.key
client-key = "/root/openvpn.key"; client-key = "/root/openvpn.key";
domain = "vpn.xenia.me.uk"; domain = "vpn.xenia.me.uk";
@ -17,9 +17,24 @@ in {
./traefik/nextcloud.nix ./traefik/nextcloud.nix
./traefik/qbittorrent.nix ./traefik/qbittorrent.nix
]; ];
services.syncthing = { services.syncthing = let
user = "xenia"; user = "xenia";
dataDir = "/var/lib/syncthing";
in {
user = user;
group = "users"; group = "users";
dataDir = dataDir;
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");
};
}; };
networking = { networking = {

View file

@ -1,21 +1,19 @@
{...}: let {...}: let
user = "elitherl"; user = "elitherl";
dataDir = "/home/${user}";
in { in {
imports = [./syncthing]; imports = [./syncthing];
services.syncthing = { services.syncthing = {
user = user; user = user;
group = "users"; group = "users";
dataDir = "/home/${user}"; dataDir = dataDir;
folders = { folders = {
"Archive".enable = false; "Archive".enable = false;
"Books".enable = false; "Books".enable = false;
"Comics".enable = false; "Comics".enable = false;
"Documents".enable = false; "Documents".enable = false;
"Exports".enable = false; "Exports".enable = false;
"Notes".path = "~/notes";
"Pictures".enable = false; "Pictures".enable = false;
"Xochitl".enable = false;
"Zotero".path = "~/Documents/Zotero";
}; };
}; };
} }

View file

@ -1,21 +1,11 @@
{...}: let {...}: let
user = "xenia"; user = "xenia";
dataDir = "/home/${user}";
in { in {
imports = [./sshd ./syncthing]; imports = [./sshd ./syncthing];
services.syncthing = { services.syncthing = {
user = user; user = user;
group = "users"; group = "users";
dataDir = "/home/${user}"; dataDir = dataDir;
folders = {
"Archive".path = "~/Documents/Archive";
"Books".path = "~/Documents/Books";
"Comics".path = "~/Documents/Comics";
"Documents".path = "~/Documents/Sync";
"Exports".path = "~/Documents/Exports";
"Notes".path = "~/notes";
"Pictures".path = "~/Pictures";
"Xochitl".enable = false;
"Zotero".path = "~/Documents/Zotero";
};
}; };
} }

View file

@ -24,43 +24,43 @@ in {
folders = { folders = {
"Archive" = { "Archive" = {
id = "hwnqy-xzcdx"; id = "hwnqy-xzcdx";
path = lib.mkDefault (defaultDataDir + "/Archive"); path = lib.mkDefault "~/Documents/Archive";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.desktops; devices = deviceGroups.desktops;
}; };
"Books" = { "Books" = {
id = "zjmxy-ycmbq"; id = "zjmxy-ycmbq";
path = lib.mkDefault (defaultDataDir + "/Books"); path = lib.mkDefault "~/Documents/Books";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.desktops; devices = deviceGroups.desktops;
}; };
"Comics" = { "Comics" = {
id = "kc2h0-q3wot"; id = "kc2h0-q3wot";
path = lib.mkDefault (defaultDataDir + "/Comics"); path = lib.mkDefault "~/Documents/Comics";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.desktops; devices = deviceGroups.desktops;
}; };
"Documents" = { "Documents" = {
id = "qc6qa-bipsd"; id = "qc6qa-bipsd";
path = lib.mkDefault (defaultDataDir + "/Documents"); path = lib.mkDefault "~/Documents/Sync";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.desktops; devices = deviceGroups.desktops;
}; };
"Exports" = { "Exports" = {
id = "tof2e-pdtde"; id = "tof2e-pdtde";
path = lib.mkDefault (defaultDataDir + "/Exports"); path = lib.mkDefault "~/Documents/Exports";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.desktops; devices = deviceGroups.desktops;
}; };
"Notes" = { "Notes" = {
id = "4ggjz-5dyop"; id = "4ggjz-5dyop";
path = lib.mkDefault (defaultDataDir + "/Notes"); path = lib.mkDefault "~/notes";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.all; devices = deviceGroups.all;
}; };
"Pictures" = { "Pictures" = {
id = "ziuj8-rm6dn"; id = "ziuj8-rm6dn";
path = lib.mkDefault (defaultDataDir + "/Pictures"); path = lib.mkDefault "~/Pictures";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.personal; devices = deviceGroups.personal;
}; };
@ -72,7 +72,7 @@ in {
}; };
"Zotero" = { "Zotero" = {
id = "huyvn-liwc9"; id = "huyvn-liwc9";
path = lib.mkDefault (defaultDataDir + "/Zotero"); path = lib.mkDefault "~/Documents/Zotero";
ignorePerms = true; ignorePerms = true;
devices = deviceGroups.all; devices = deviceGroups.all;
}; };