From 8a76c27dae27c69b45dee014e735eb9db44a5747 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Sun, 22 Oct 2023 07:39:51 +0100 Subject: [PATCH] Add elfeed database to syncthing Update syncthing definition to use dataDir in folder path, reduce redefinition by just changing dataDir if they should be somewhere else --- hosts/Legion/configuration.nix | 9 +-------- services/syncthing/default.nix | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hosts/Legion/configuration.nix b/hosts/Legion/configuration.nix index caf39803..4a26dc8b 100644 --- a/hosts/Legion/configuration.nix +++ b/hosts/Legion/configuration.nix @@ -29,14 +29,7 @@ in { }; }; services = { - syncthing = let dataDir = "/var/lib/syncthing"; - in { - inherit dataDir; - settings.folders = { - "Pictures".path = dataDir + "/Pictures"; - "Zotero".path = dataDir + "/Zotero"; - }; - }; + syncthing.dataDir = "/var/lib/syncthing"; openvpn = { restartAfterSleep = true; servers.xenia.config = '' diff --git a/services/syncthing/default.nix b/services/syncthing/default.nix index b9134f96..ae84d4a0 100644 --- a/services/syncthing/default.nix +++ b/services/syncthing/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, user, ... }: let devices = [ "Ion" "Legion" "Northstar" "Ronin" "Vanguard" ]; in { - services.syncthing = { + services.syncthing = rec { inherit user; inherit (config.users.users.${user}) group; enable = true; @@ -22,17 +22,23 @@ in { "I366QNQ-D3FTDRX-RNOTXMW-YITZXOF-DSCDMQD-63Q72LI-ME2Y4HZ-T34RMQK"; }; folders = { - "Pictures" = { - id = "ziuj8-rm6dn"; - path = lib.mkDefault "~/Pictures"; + "Elfeed" = { + inherit devices; + id = "hnnxy-lb5af"; + path = "${dataDir}/.elfeed"; + ignorePerms = true; + }; + "Pictures" = { + inherit devices; + id = "ziuj8-rm6dn"; + path = "${dataDir}/Pictures"; ignorePerms = true; - devices = devices; }; "Zotero" = { + inherit devices; id = "huyvn-liwc9"; - path = lib.mkDefault "~/Documents/Zotero"; + path = "${dataDir}/Documents/Zotero"; ignorePerms = true; - devices = devices; }; }; };