Commit ca8802cfe413

Vincent Demeester <vincent@sbr.pm>
2026-02-18 16:37:18
refactor(home): move syncthing WantedBy to common
Centralized syncthing systemd WantedBy multi-user.target in home/common/services/syncthing.nix, removed from 7 host home.nix.
1 parent 8f72153
home/common/services/syncthing.nix
@@ -14,6 +14,9 @@ let
 in
 {
   warnings = [ "Home syncthing for ${hostname} with folders: ${folderList}" ];
+  # Start syncthing with the system, not just the user session
+  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
+
   services.syncthing = {
     enable = true;
     overrideFolders = false; # TODO Just in case, will probably set to true later
systems/aix/extra.nix
@@ -35,7 +35,6 @@ in
 
   networking.firewall.enable = false;
 
-
   services = {
     # Rsync data from aion to aix for local network access
     rsync-replica = {
systems/aix/home.nix
@@ -1,3 +1,2 @@
 _: {
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
 }
systems/aomi/extra.nix
@@ -31,7 +31,6 @@
     denyinterfaces wg0
   '';
 
-
   services = {
     logind.settings.Login = {
       HandleLidSwitch = "ignore";
systems/aomi/home.nix
@@ -20,8 +20,6 @@
     socketActivation.enable = true;
   };
 
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
-
   home.sessionVariables = {
     PASSAGE_IDENTITIES_FILE = pkgs.lib.mkForce "${config.home.homeDirectory}/.ssh/id_ed25519";
   };
systems/athena/extra.nix
@@ -12,7 +12,6 @@
 
   networking.firewall.enable = false;
 
-
   # Age secrets for imapfilter
   age.secrets."icloud-vdemeester-password" = {
     file = ../../secrets/mails/icloud-vdemeester.age;
systems/athena/home.nix
@@ -1,4 +1,4 @@
-{ lib, ... }:
+{ ... }:
 {
   imports = [
     ../../home/common/desktop/passage.nix
@@ -8,5 +8,4 @@
     ../../home/common/services/mail-monitor.nix
   ];
 
-  systemd.user.services.syncthing.Install.WantedBy = lib.mkForce [ "multi-user.target" ];
 }
systems/demeter/home.nix
@@ -1,3 +1,2 @@
 _: {
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
 }
systems/kerkouane/extra.nix
@@ -112,7 +112,6 @@ in
     group = "root";
   };
 
-
   # Allow Caddy to access git repositories in vincent's home
   users.users.caddy.extraGroups = [ "users" ];
 
systems/kerkouane/home.nix
@@ -1,3 +1,2 @@
 _: {
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
 }
systems/sakhalin/extra.nix
@@ -116,7 +116,6 @@ in
     group = "searx";
   };
 
-
   systemd.services.n8n.environment = {
     N8N_SECURE_COOKIE = "false";
     PATH = lib.mkForce "/run/current-system/sw/bin";
systems/sakhalin/home.nix
@@ -1,6 +1,5 @@
 { pkgs, ... }:
 {
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
   home.packages = with pkgs; [
     download-kiwix-zim
   ];
systems/shikoku/extra.nix
@@ -23,7 +23,6 @@
     "aspnetcore-runtime-6.0.36"
   ];
 
-
   services = {
     wireguard = {
       enable = true;
systems/shikoku/home.nix
@@ -1,3 +1,2 @@
 _: {
-  systemd.user.services.syncthing.Install.WantedBy = [ "multi-user.target" ];
 }