summaryrefslogtreecommitdiff
path: root/os/srv/syncthing.nix
diff options
context:
space:
mode:
authoradi <adikro@disroot.org>2026-07-29 17:09:58 +0200
committeradi <adikro@disroot.org>2026-07-29 17:09:58 +0200
commit39a2b09c27bb74c9e59d1772764f901e3c8fb9e4 (patch)
tree0ba58e6fbf086a85d875df1c10f6d23bc3bbc7da /os/srv/syncthing.nix
parent8a820cacee1ff07ae7397d053b26e66f7086a4a4 (diff)
revamped flake.nix, removed homelab specific modulesstaging
Diffstat (limited to 'os/srv/syncthing.nix')
-rw-r--r--os/srv/syncthing.nix136
1 files changed, 0 insertions, 136 deletions
diff --git a/os/srv/syncthing.nix b/os/srv/syncthing.nix
deleted file mode 100644
index 0c5e53e..0000000
--- a/os/srv/syncthing.nix
+++ /dev/null
@@ -1,136 +0,0 @@
-{
- config,
- lib,
- username,
- ...
-}:
-let
- cfg = config.os.srv.syncthing;
- allFolders = {
- "openmw-config" = {
- path = "/home/${username}/.config/openmw";
- id = "openmw-config";
- devices = [ "oci" ];
- versioning = {
- type = "simple";
- params.keep = "3";
- };
- ignorePatterns = [
- "settings.cfg"
- "*.log"
- ];
- };
-
- "openmw-mods" = {
- path = "/home/${username}/games/openmw";
- id = "openmw-mods";
- devices = [ "oci" ];
- versioning = {
- type = "trashcan";
- params.cleanoutDays = "7";
- };
- };
-
- "game-saves" = {
- path = "/home/${username}/.saves";
- id = "game-saves";
- devices = [ "oci" ];
- versioning = {
- type = "staggered";
- params = {
- cleanInterval = "3600";
- maxAge = "2592000";
- };
- };
- };
-
- "keepass" = {
- path = "/home/${username}/.keepass";
- id = "keepass";
- devices = [
- {
- name = "oci";
- encryptionPasswordFile = config.sops.secrets."syncthing/encryption/keepass".path;
- }
- ];
- versioning = {
- type = "staggered";
- params = {
- cleanInterval = "3600";
- maxAge = "31536000";
- };
- };
- };
-
- "sync" = {
- path = "/home/${username}/sync";
- id = "sync";
- devices = [
- {
- name = "oci";
- encryptionPasswordFile = config.sops.secrets."syncthing/encryption/sync".path;
- }
- ];
- versioning = {
- type = "staggered";
- params = {
- cleanInterval = "3600";
- maxAge = "15552000";
- };
- };
- };
-
- "music" = {
- path = "/storage/music";
- id = "music";
- devices = [ "oci" ];
- versioning = {
- type = "trashcan";
- params.cleanoutDays = "14";
- };
- };
- };
- activeFoldersSet = lib.filterAttrs (name: _: builtins.elem name cfg.activeFolders) allFolders;
-
- syncDirs = lib.mapAttrsToList (_: folder: folder.path) activeFoldersSet;
-in
-{
- options.os.srv.syncthing = {
- enable = lib.mkEnableOption "enables syncthing syncing";
-
- activeFolders = lib.mkOption {
- type = lib.types.listOf (
- lib.types.enum [
- "openmw-config"
- "openmw-mods"
- "game-saves"
- "keepass"
- "sync"
- "music"
- ]
- );
- default = [
- "keepass"
- "sync"
- ];
- description = "List of Syncthing folders to enable and sync on this specific machine.";
- };
- };
- config = lib.mkIf cfg.enable {
- systemd.tmpfiles.rules = map (path: "d ${path} 0755 ${username} users -") syncDirs;
-
- services.syncthing = {
- enable = true;
- user = username;
- dataDir = "/home/${username}/.local/share/syncthing";
- configDir = "/home/${username}/.config/syncthing";
- # guiPasswordFile = config.sops.secrets."syncthing/gui_password".path;
-
- settings = {
- devices."oci".id = "DQXGVDC-KGPM6RK-5NDEBJJ-R7PEWYZ-N6Z3WFZ-TSVJG5X-235SHG4-4BEJNQJ";
-
- folders = activeFoldersSet;
- };
- };
- };
-}