From eb6cdc1ba786ba16d4168abe5dfe38650ef25939 Mon Sep 17 00:00:00 2001 From: ttacquisti Date: Fri, 23 Feb 2024 20:49:29 +0100 Subject: [PATCH] Add basic syncthing configuration as service --- config/system/default.nix | 1 + config/system/syncthing.nix | 13 +++++++++++++ options.nix | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 config/system/syncthing.nix diff --git a/config/system/default.nix b/config/system/default.nix index d00e303..4440537 100644 --- a/config/system/default.nix +++ b/config/system/default.nix @@ -24,6 +24,7 @@ ./printer.nix ./services.nix ./steam.nix + ./syncthing.nix ./vm.nix ]; } diff --git a/config/system/syncthing.nix b/config/system/syncthing.nix new file mode 100644 index 0000000..85e4605 --- /dev/null +++ b/config/system/syncthing.nix @@ -0,0 +1,13 @@ +{ pkgs, config, lib, ... }: + +let inherit (import ../../options.nix) syncthing username userHome; in +lib.mkIf (syncthing == true) { + services = { + syncthing = { + enable = true; + user = "${username}"; + dataDir = "/home/${username}"; # Default folder for new synced folders + configDir = "/home/${username}/.config/syncthing"; # Folder for Syncthing's settings and keys + }; + }; +} diff --git a/options.nix b/options.nix index 28c4f61..c0872da 100644 --- a/options.nix +++ b/options.nix @@ -82,5 +82,8 @@ in { # Enable Python & PyCharm python = false; + + # Enable SyncThing + syncthing = true; }