mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 18:41:34 +01:00
Refactor syncthing module
This commit is contained in:
parent
3fb991b596
commit
fcda8740bf
1 changed files with 18 additions and 50 deletions
|
|
@ -5,14 +5,12 @@
|
|||
config = lib.mkIf config.myConfig.syncthing.enable {
|
||||
services.syncthing = {
|
||||
enable = true;
|
||||
openDefaultPorts = true;
|
||||
|
||||
user = "seb";
|
||||
group = "users";
|
||||
dataDir = "/home/seb";
|
||||
|
||||
overrideDevices = true;
|
||||
overrideFolders = true;
|
||||
|
||||
settings = {
|
||||
devices = {
|
||||
north.id = "FAJS5WM-UAWGW2U-FXCGPSP-VAUOTGM-XUKSEES-D66PMCJ-WBODJLV-XTNCRA7";
|
||||
|
|
@ -20,54 +18,24 @@
|
|||
|
||||
folders =
|
||||
let
|
||||
allDevices = [
|
||||
genFolders =
|
||||
folders:
|
||||
lib.genAttrs folders (name: {
|
||||
path = "~/${name}";
|
||||
ignorePerms = false;
|
||||
devices = [
|
||||
"north"
|
||||
];
|
||||
staggeredVersioning = {
|
||||
type = "staggered";
|
||||
params = {
|
||||
cleanInterval = "3600"; # 1 hour in seconds
|
||||
maxAge = "15552000"; # 180 days in seconds
|
||||
};
|
||||
};
|
||||
});
|
||||
in
|
||||
{
|
||||
Documents = {
|
||||
path = "/home/seb/Documents";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Downloads = {
|
||||
path = "/home/seb/Downloads";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Pictures = {
|
||||
path = "/home/seb/Pictures";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Music = {
|
||||
path = "/home/seb/Music";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Videos = {
|
||||
path = "/home/seb/Videos";
|
||||
devices = allDevices;
|
||||
versioning = staggeredVersioning;
|
||||
ignorePerms = false;
|
||||
};
|
||||
Projects = {
|
||||
path = "/home/seb/Projects";
|
||||
devices = allDevices;
|
||||
ignorePerms = false;
|
||||
};
|
||||
};
|
||||
genFolders [
|
||||
"Documents"
|
||||
"Downloads"
|
||||
"Music"
|
||||
"Pictures"
|
||||
"Projects"
|
||||
"Videos"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue