# Opt-in services & integrations — off by default, one toggle each, enabled # in system.nix (see the commented examples in the downstream template). # These are system services: Tailscale is system-only, and Syncthing runs as # the login user. Their own `nomarchy.services.*` namespace, distinct from the # distro's core `nomarchy.system.*` toggles. `username` (from specialArgs) is # read lazily, only when Syncthing is enabled. { config, lib, ... }@args: let cfg = config.nomarchy.services; in { options.nomarchy.services = { tailscale.enable = lib.mkEnableOption '' Tailscale, the mesh VPN — ships the daemon; authenticate once with `sudo tailscale up`''; syncthing.enable = lib.mkEnableOption '' Syncthing continuous file sync, running as the login user — add folders and devices in the web UI at http://127.0.0.1:8384''; }; config = lib.mkMerge [ (lib.mkIf cfg.tailscale.enable { services.tailscale.enable = true; }) (lib.mkIf cfg.syncthing.enable { services.syncthing = { enable = true; user = args.username; # Manage folders/devices in the GUI; don't let the (empty) declarative # config wipe them on a rebuild. overrideDevices = false; overrideFolders = false; guiAddress = "127.0.0.1:8384"; }; }) ]; }