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
client-key = "/root/openvpn.key";
domain = "vpn.xenia.me.uk";
@ -17,9 +17,24 @@ in {
./traefik/nextcloud.nix
./traefik/qbittorrent.nix
];
services.syncthing = {
services.syncthing = let
user = "xenia";
dataDir = "/var/lib/syncthing";
in {
user = user;
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 = {

View file

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

View file

@ -1,21 +1,11 @@
{...}: let
user = "xenia";
dataDir = "/home/${user}";
in {
imports = [./sshd ./syncthing];
services.syncthing = {
user = user;
group = "users";
dataDir = "/home/${user}";
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";
};
dataDir = dataDir;
};
}

View file

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