Initial commit
This commit is contained in:
79
modules/hm/syncthing.nix
Normal file
79
modules/hm/syncthing.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
lib,
|
||||
hosts,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services.syncthing = {
|
||||
guiAddress = lib.mkDefault "127.0.0.1:8384";
|
||||
overrideDevices = false;
|
||||
overrideFolders = false;
|
||||
cert = "~/.config/syncthing/cert";
|
||||
key = "~/.config/syncthing/key";
|
||||
|
||||
settings = {
|
||||
folders = {
|
||||
"Sync" = {
|
||||
id = "default";
|
||||
type = "sendreceive";
|
||||
enabled = lib.mkDefault true;
|
||||
label = "Sync";
|
||||
path = "~/Sync";
|
||||
};
|
||||
"Documents" = {
|
||||
id = "ikwrq-ahv5a";
|
||||
type = "sendreceive";
|
||||
enabled = lib.mkDefault false;
|
||||
label = "Documents";
|
||||
path = "~/Documents";
|
||||
};
|
||||
"Music" = {
|
||||
id = "6ytyt-ngvta";
|
||||
type = "sendreceive";
|
||||
enabled = lib.mkDefault false;
|
||||
label = "Music";
|
||||
path = "~/Music";
|
||||
};
|
||||
"Obsidian" = {
|
||||
id = "hyeaf-ygups";
|
||||
type = "sendreceive";
|
||||
enabled = lib.mkDefault false;
|
||||
label = "Obsidian";
|
||||
path = "~/Obsidian";
|
||||
};
|
||||
"Camera S25" = {
|
||||
id = "sm-s938b_9wbf-фото";
|
||||
enabled = lib.mkDefault false;
|
||||
type = "receiveonly";
|
||||
label = "Camera S25";
|
||||
path = "~/Photos/S25";
|
||||
};
|
||||
"PhotoArchive" = {
|
||||
id = "6detn-xjbco";
|
||||
type = "receiveonly";
|
||||
enabled = lib.mkDefault false;
|
||||
label = "PhotoArchive";
|
||||
path = "~/Photos/archive";
|
||||
ignorePerms = true;
|
||||
};
|
||||
"books" = {
|
||||
id = "6st45-t9jej";
|
||||
type = "sendreceive";
|
||||
enabled = lib.mkDefault false;
|
||||
label = "Books";
|
||||
path = "/mnt/hdd/Books";
|
||||
};
|
||||
};
|
||||
|
||||
devices = lib.mapAttrs (
|
||||
name: host:
|
||||
lib.mkIf (host ? syncthing) {
|
||||
addresses = [
|
||||
"tcp://${host.ip}:22000"
|
||||
];
|
||||
id = host.syncthing;
|
||||
}
|
||||
) hosts;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user