diff options
| author | adikro <adikro@disroot.org> | 2026-03-07 22:27:05 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2026-03-07 22:27:05 +0100 |
| commit | 11d05469368ecfe533c7720e7f5b624f2f8f19fc (patch) | |
| tree | c666f76157b6f9158a2faa723efbf10d1d3dab03 /os/srv/syncthing.nix | |
| parent | cacaadb79a73fca27bd8bbc0a33a0713d2379655 (diff) | |
...
Diffstat (limited to 'os/srv/syncthing.nix')
| -rw-r--r-- | os/srv/syncthing.nix | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/os/srv/syncthing.nix b/os/srv/syncthing.nix index 332bb54..b350428 100644 --- a/os/srv/syncthing.nix +++ b/os/srv/syncthing.nix @@ -6,39 +6,34 @@ }: let cfg = config.os.srv.syncthing; + syncDirs = lib.mapAttrsToList (_: folder: folder.path) config.services.syncthing.settings.folders; in { options.os.srv.syncthing.enable = lib.mkEnableOption "enables syncthing syncing"; config = lib.mkIf cfg.enable { + systemd.tmpfiles.rules = map (path: "d ${path} 0755 ${username} users -") syncDirs; + services.syncthing = { enable = true; - user = "${username}"; + user = username; dataDir = "/home/${username}/.local/share/syncthing"; configDir = "/home/${username}/.config/syncthing"; - guiPasswordFile = "/run/secrets/syncthing/gui_password"; + guiPasswordFile = config.sops.secrets."syncthing/gui_password".path; settings = { - devices = { - "desktop" = { - id = "YGMWGOB-LTJUDM7-CY25MAF-NPE7J4J-KYRNPB5-ZHD5DBI-VNRAXI6-LIP2DQP"; - }; - "laptop" = { - id = ""; - }; - "thinkpad" = { - id = ""; - }; - }; + devices."oci".id = "DQXGVDC-KGPM6RK-5NDEBJJ-R7PEWYZ-N6Z3WFZ-TSVJG5X-235SHG4-4BEJNQJ"; + folders = { "game-saves" = { path = "/home/${username}/.saves"; - id = "shared-saves-v1"; + id = "game-saves"; devices = [ - "desktop" - "laptop" - "thinkpad" + { + name = "oci"; + encryptionPasswordFile = config.sops.secrets."syncthing/encryption/game-saves".path; + compression = "always"; + } ]; - versioning = { type = "staggered"; params = { @@ -47,6 +42,22 @@ in }; }; }; + + "keepass" = { + path = "/home/${username}/.keepass"; + id = "keepass"; + devices = [ + { + name = "oci"; + encryptionPasswordFile = config.sops.secrets."syncthing/encryption/keepass".path; + compression = "metadata"; + } + ]; + versioning = { + type = "simple"; + params.keep = "10"; + }; + }; }; }; }; |
