From 4b4d573807667c444294b0f902416b7057b4b764 Mon Sep 17 00:00:00 2001 From: KoenDR06 Date: Sun, 30 Jun 2024 00:01:37 +0200 Subject: [PATCH] Added Syncthing and SOPS --- machines/common/configuration.nix | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/machines/common/configuration.nix b/machines/common/configuration.nix index c2b17d3..8a26d6c 100644 --- a/machines/common/configuration.nix +++ b/machines/common/configuration.nix @@ -59,42 +59,41 @@ keyFile = "/home/horseman/.config/sops/age/keys.txt"; generateKey = true; }; - secrets = { - "syncthing/solis".owner = "horseman"; - "syncthing/terra".owner = "horseman"; "syncthing/luna".owner = "horseman"; + "syncthing/terra".owner = "horseman"; + "syncthing/solis".owner = "horseman"; "syncthing/gui_user".owner = "horseman"; - "syncthing/gui_password".owner = "horseman"; - + "syncthing/gui_password".owner = "horseman"; + }; + templates = { + "syncluna".content = ''${config.sops.placeholder."syncthing/luna"}''; + "syncterra".content = ''${config.sops.placeholder."syncthing/terra"}''; + "syncsolis".content = ''${config.sops.placeholder."syncthing/solis"}''; }; }; -# services.syncthing.enable = true; - services.syncthing = { enable = true; user = "horseman"; dataDir = "/home/horseman"; - configDir = "/home/horseman/.config/syncthing"; + configDir = "/home/horseman/nix-config/config/syncthing"; overrideDevices = true; overrideFolders = true; settings = { devices = { - "luna" = config.sops.secrets."syncthing/luna"; - "terra" = config.sops.secrets."syncthing/terra"; -# "solis" = config.sops.secrets."syncthing/solis"; + "luna" = { id = config.sops.templates."syncluna".content; }; + "terra" = { id = config.sops.templates."syncterra".content; }; + "solis" = { id = config.sops.templates."syncsolis".content; }; }; folders = { "Documents" = { path = "/home/horseman/Documents"; -# devices = [ "solis" "terra" "luna" ]; - devices = [ "terra" "luna" ]; + devices = [ "luna" "terra" "solis" ]; }; "Programming" = { path = "/home/horseman/Programming"; -# devices = [ "solis" "terra" "luna" ]; - devices = [ "terra" "luna" ]; + devices = [ "luna" "terra" "solis" ]; }; }; gui = {