nixos/syncthing: integrate cfg one file

This commit is contained in:
Aly Raffauf 2024-07-08 00:39:51 -04:00
parent 41852c9d1f
commit 08f91eaad6
2 changed files with 40 additions and 50 deletions

View file

@ -4,8 +4,6 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [./syncMusic.nix];
config = let config = let
cfg = config.ar.services.syncthing; cfg = config.ar.services.syncthing;
in in
@ -30,6 +28,7 @@
relaysEnabled = true; relaysEnabled = true;
urAccepted = -1; urAccepted = -1;
}; };
devices = { devices = {
"brawly" = {id = "BBIBWMR-CN4CFC4-2XMPLII-XFWXBT5-EPCZCAF-JOWAX5J-DHIGNM4-O3XQ4Q3";}; # Pixel 6a "brawly" = {id = "BBIBWMR-CN4CFC4-2XMPLII-XFWXBT5-EPCZCAF-JOWAX5J-DHIGNM4-O3XQ4Q3";}; # Pixel 6a
"fallarbor" = {id = "P4URLH4-YWLMO6J-W62ET7H-TQAO3Y6-T2FAYOY-C2VTI65-VQXHVGG-NQ76PAZ";}; # Framework 13 Intel 11th gen "fallarbor" = {id = "P4URLH4-YWLMO6J-W62ET7H-TQAO3Y6-T2FAYOY-C2VTI65-VQXHVGG-NQ76PAZ";}; # Framework 13 Intel 11th gen
@ -43,38 +42,49 @@
"wallace" = {id = "X55NQL2-H3TEJ5U-EXZPBKQ-LI6BMB4-W2ULDIJ-YNIHJHB-4ISCOJB-UHNLYAX";}; # Samsung a35 "wallace" = {id = "X55NQL2-H3TEJ5U-EXZPBKQ-LI6BMB4-W2ULDIJ-YNIHJHB-4ISCOJB-UHNLYAX";}; # Samsung a35
"winona" = {id = "IGAW5SS-WY2QN6J-5TF74YZ-6XPNPTC-RCH3HIT-ZZQKCAI-6L54IS2-SNRIMA2";}; # Pixel Tablet "winona" = {id = "IGAW5SS-WY2QN6J-5TF74YZ-6XPNPTC-RCH3HIT-ZZQKCAI-6L54IS2-SNRIMA2";}; # Pixel Tablet
}; };
folders = {
"sync" = { folders =
id = "default"; {
path = "/home/${cfg.user}/sync"; "sync" = {
devices = ["brawly" "fallarbor" "gsgmba" "iphone12" "lavaridge" "mauville" "petalburg" "rustboro" "mossdeep" "wallace" "winona"]; id = "default";
versioning = { path = "/home/${cfg.user}/sync";
type = "staggered"; devices = ["brawly" "fallarbor" "gsgmba" "iphone12" "lavaridge" "mauville" "petalburg" "rustboro" "mossdeep" "wallace" "winona"];
params = { versioning = {
cleanInterval = "3600"; type = "staggered";
maxAge = "1"; params = {
cleanInterval = "3600";
maxAge = "1";
};
}; };
}; };
};
"camera" = { "camera" = {
id = "fcsgh-dlxys"; id = "fcsgh-dlxys";
path = "/home/${cfg.user}/pics/camera"; path = "/home/${cfg.user}/pics/camera";
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"]; devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"];
versioning = { versioning = {
params.cleanoutDays = "5"; params.cleanoutDays = "5";
type = "trashcan"; type = "trashcan";
};
};
"screenshots" = {
id = "screenshots";
path = "/home/${cfg.user}/pics/screenshots";
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"];
versioning = {
params.cleanoutDays = "5";
type = "trashcan";
};
};
}
// lib.attrsets.optionalAttrs (config.ar.services.syncthing.syncMusic) {
"music" = {
id = "6nzmu-z9der";
path = config.ar.services.syncthing.musicPath;
devices = ["lavaridge" "mauville" "petalburg" "rustboro" "wallace"];
}; };
}; };
"screenshots" = {
id = "screenshots";
path = "/home/${cfg.user}/pics/screenshots";
devices = ["brawly" "fallarbor" "lavaridge" "mauville" "petalburg" "rustboro" "wallace" "winona"];
versioning = {
params.cleanoutDays = "5";
type = "trashcan";
};
};
};
}; };
}; };
}; };

View file

@ -1,20 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.ar.services.syncthing.syncMusic {
services.syncthing = {
settings = {
folders = {
"music" = {
id = "6nzmu-z9der";
path = config.ar.services.syncthing.musicPath;
devices = ["lavaridge" "mauville" "petalburg" "rustboro" "wallace"];
};
};
};
};
};
}