complete-computing-environment/syncthing-tray.org

31 lines
1.5 KiB
Org Mode

:PROPERTIES:
:ID: 20230220T220556.588418
:ROAM_ALIASES: syncthingtray syncthing-tray "Syncthing Tray"
:END:
#+TITLE: Controlling Syncthing on my Endpoints
#+ARCOLOGY_KEY: cce/syncthing-tray
#+ARCOLOGY_ALLOW_CRAWL: t
A shortcoming of the [[id:arroyo/arroyo][Arroyo Systems Management]] data model is that I can't have modules in the same file with different roles: If I were to install [[id:cce/syncthing][Syncthing]]'s tray files in the Syncthing page, it pulls in a whole Qt and KDE Plasma environment on to my server! So I define it here. [[id:09fa0674-ad3b-43c5-8d7c-6b532346a772][open threads]]
So this is the tray module for [[id:cce/syncthing][Syncthing]] which is installed in [[id:cce/my_nixos_configuration][My NixOS configuration]] for endpoints.
#+ARROYO_HOME_MODULE: hm/syncthing-tray.nix
#+ARROYO_SYSTEM_ROLE: endpoint
#+AUTO_TANGLE: t
#+begin_src nix :tangle ~/arroyo-nix/hm/syncthing-tray.nix
{ lib, pkgs, ... }:
{
services.syncthing.tray.enable = true;
systemd.user.services.syncthingtray.Service.ExecStart = lib.mkForce "${pkgs.syncthingtray}/bin/syncthingtray --wait";
systemd.user.services.syncthingtray.Unit.After = lib.mkForce ["graphical-session-pre.target"];
systemd.user.services.syncthingtray.Unit.Requires = lib.mkForce [];
home.packages = [ pkgs.syncthingtray ];
}
#+end_src
I modify the =systemd= configuration to wait for the Plasma tray to become available since there is no =tray.target= which the default configuration relies on.