From a8cc32d0e068a40970580eb00f0e1f66cd34f4a3 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Thu, 17 Oct 2024 23:20:28 +0200 Subject: [PATCH] Enable `syncthing` on `sisko` --- hosts/kirk/default.nix | 1 + modules/syncthing/default.nix | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hosts/kirk/default.nix b/hosts/kirk/default.nix index 7838975..aaf03b0 100644 --- a/hosts/kirk/default.nix +++ b/hosts/kirk/default.nix @@ -34,6 +34,7 @@ "adb" "binfmt" "prometheus-exporters" + "syncthing" ] ++ [ ./disko.nix diff --git a/modules/syncthing/default.nix b/modules/syncthing/default.nix index b857df4..eb25947 100644 --- a/modules/syncthing/default.nix +++ b/modules/syncthing/default.nix @@ -4,12 +4,13 @@ syncthing = { enable = true; guiAddress = "${config.networking.hostName}.fleet:8434"; - user = config.ccr.username; - dataDir = "/home/${config.ccr.username}"; + # TODO Use the home-manager module instead of the following conditions + user = if config.networking.hostName == "sisko" then "syncthing" else "ccr"; + dataDir = if config.networking.hostName == "sisko" then "/mnt/hd/syncthing" else "/home/ccr"; settings = { options = { urAccepted = 1; # anonymous usage data report - globalAnnounceEnabled = false; # Only sync on the VPN + globalAnnounceEnabled = false; # Only sync when connected to the VPN }; devices = { picard = { @@ -19,7 +20,7 @@ ]; }; sisko = { - id = "L5RAQXR-6U3ANNK-UJJ5AVN-37VKQRB-UK6HXSU-NN3V6HF-JNZEVA5-NI6UEAP"; + id = "5JYQLMP-KNBMSOE-I452UDU-UTKPXJI-K27X2DI-MSCSRCG-6V54Q6U-NVGXPQA"; addresses = [ "tcp://sisko.fleet" ]; @@ -31,7 +32,7 @@ ]; }; oneplus8t = { - id = "76BJ2ZE-FPFDWUZ-3UZIENZ-TS6YBGG-EZSF6UE-GLHRBQ2-KTHTRMI-3JWNRAT"; + id = "KMB2YRF-DGTWU24-SLITU23-5TN7BMQ-6PFAQQZ-CZ7J2QL-PIGVBTU-VRFRMQV"; addresses = [ "tcp://oneplus8t.fleet" ]; @@ -41,9 +42,9 @@ org = { path = { - picard = "/home/${config.ccr.username}/org"; - sisko = "/home/${config.ccr.username}/org"; - kirk = "/home/${config.ccr.username}/org"; + picard = "/home/ccr/org"; + sisko = "/mnt/hd/syncthing/org"; + kirk = "/home/ccr/org"; } .${config.networking.hostName}; devices = [ @@ -56,9 +57,9 @@ sync = { path = { - picard = "/home/${config.ccr.username}/sync"; - sisko = "/home/${config.ccr.username}/sync"; - kirk = "/home/${config.ccr.username}/sync"; + picard = "/home/ccr/sync"; + sisko = "/mnt/hd/syncthing/sync"; + kirk = "/home/ccr/sync"; } .${config.networking.hostName}; devices = [