From 2c8a4dd99efd61298bc18393e7fcbf6063db8671 Mon Sep 17 00:00:00 2001 From: adikro Date: Sun, 8 Feb 2026 18:03:39 +0100 Subject: ... --- os/srv/syncthing.nix | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 os/srv/syncthing.nix (limited to 'os/srv/syncthing.nix') diff --git a/os/srv/syncthing.nix b/os/srv/syncthing.nix new file mode 100644 index 0000000..1531c04 --- /dev/null +++ b/os/srv/syncthing.nix @@ -0,0 +1,54 @@ +{ + config, + lib, + username, + ... +}: +let + cfg = config.os.srv.syncthing; +in +{ + options.os.srv.syncthing.enable = lib.mkEnableOption "enables syncthing syncing"; + config = lib.mkIf cfg.enable { + 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 = { + "desktop" = { + id = "YGMWGOB-LTJUDM7-CY25MAF-NPE7J4J-KYRNPB5-ZHD5DBI-VNRAXI6-LIP2DQP"; + }; + "laptop" = { + id = ""; + }; + "thinkpad" = { + id = ""; + }; + }; + folders = { + "game-saves" = { + path = "/home/${username}/.saves"; + id = "shared-saves-v1"; + devices = [ + "desktop" + "laptop" + "thinkpad" + ]; + + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "2592000"; + }; + }; + }; + }; + }; + }; + }; +} -- cgit v1.3