feat: add syncthing

add codes

fix: change restic directories

syncthing
This commit is contained in:
gwg313 2024-02-18 15:00:40 -05:00
commit a9df4938e3
Signed by: gwg313
GPG key ID: 60FF63B4826B7400
6 changed files with 76 additions and 2 deletions

View file

@ -13,7 +13,7 @@
repository = "/backups"; repository = "/backups";
initialize = true; initialize = true;
passwordFile = "${config.sops.secrets.restic_key.path}"; passwordFile = "${config.sops.secrets.restic_key.path}";
paths = ["/home/${user}/Projects" "/home/${user}/Documents" "/home/${user}/.local/share/password-store" "/home/${user}/.local/share/buku"]; paths = ["/home/${user}/repos" "/home/${user}/Documents" "/home/${user}/.local/share/password-store" "/home/${user}/.local/share/buku"];
timerConfig = { timerConfig = {
onCalendar = "saturday 23:00"; onCalendar = "saturday 23:00";
}; };

View file

@ -20,5 +20,6 @@
sublime-music # A modern and feature-rich music player with a clean user interface and advanced playback options. sublime-music # A modern and feature-rich music player with a clean user interface and advanced playback options.
thunderbird # Mozilla Thunderbird, a powerful and customizable email client with integrated calendaring and chat features. thunderbird # Mozilla Thunderbird, a powerful and customizable email client with integrated calendaring and chat features.
wireshark # Open-source network protocol analyzer for real-time packet inspection and analysis. wireshark # Open-source network protocol analyzer for real-time packet inspection and analysis.
nicotine-plus
]; ];
} }

View file

@ -6,6 +6,7 @@
matchBlocks = { matchBlocks = {
"router" = { "router" = {
hostname = "router.local.gwg313.xyz"; hostname = "router.local.gwg313.xyz";
user = "glen";
identityFile = "/home/gwg313/.ssh/home/id_ed25519"; identityFile = "/home/gwg313/.ssh/home/id_ed25519";
}; };
"github.com" = { "github.com" = {

View file

@ -17,7 +17,7 @@
settings = { settings = {
devices = { devices = {
"grymforge" = {id = "REALLY-LONG-LAPTOP-SYNCTHING-KEY-HERE";}; "grymforge" = {id = "N2TYFZ4-ODIIHIZ-UP27V4V-NYMAZNI-SIATS5S-5NTM6JX-A67HCZ5-ZB4TVQJ";};
}; };
folders = { folders = {
@ -43,6 +43,17 @@
}; };
}; };
}; };
"obsidian" = {
path = "/home/gwg313/vault";
devices = ["grymforge"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600";
maxAge = "15768000";
};
};
};
}; };
}; };
}; };

View file

@ -28,6 +28,7 @@
../../common/virtualization/libvirt.nix ../../common/virtualization/libvirt.nix
../../common/nixos/sysctl/default.nix ../../common/nixos/sysctl/default.nix
./syncthing.nix
./auditd.nix ./auditd.nix
./kernel.nix ./kernel.nix
./sysctl.nix ./sysctl.nix

View file

@ -0,0 +1,60 @@
{
config,
user,
...
}: {
services.syncthing = {
enable = true;
dataDir = "/home/gwg313";
openDefaultPorts = true;
configDir = "/home/gwg313/.config/syncthing";
user = "gwg313";
group = "users";
guiAddress = "127.0.0.1:8384";
overrideDevices = true;
overrideFolders = true;
settings = {
devices = {
"candlekeep" = {id = "762A3TK-Z3ZX6DG-V4VASMJ-H6DJHE5-PBD6YZQ-MPILUWT-E7EY4O7-4EAPHAX";};
};
folders = {
"repos" = {
path = "/home/gwg313/repos";
devices = ["candlekeep"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600";
maxAge = "15768000";
};
};
};
"documents" = {
path = "/home/gwg313/Documents";
devices = ["candlekeep"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600";
maxAge = "15768000";
};
};
};
"obsidian" = {
path = "/home/gwg313/vault";
devices = ["candlekeep"];
versioning = {
type = "staggered";
params = {
cleanInterval = "3600";
maxAge = "15768000";
};
};
};
};
};
};
}