1
0
Fork 0

Services: re-re-enable Syncthing Tray (the Gnome extension couldn't connect to the system service)

This commit is contained in:
Aires 2024-11-24 13:38:58 -05:00
parent 7cff2e17d0
commit 3feefc4b70
2 changed files with 18 additions and 12 deletions

View file

@ -7,7 +7,8 @@ in
{
options = {
aux.system.services.syncthing = {
enable = lib.mkEnableOption "Enables Syncthing";
enable = lib.mkEnableOption "Enables Syncthing.";
enableTray = lib.mkEnableOption "Enables the Syncthing Tray applet.";
home = lib.mkOption {
default = "/var/lib/syncthing";
type = lib.types.str;
@ -34,16 +35,22 @@ in
# If the web UI is public, open the port in the firewall
networking.firewall.allowedTCPPorts = with cfg.web; lib.mkIf (enable && public) [ port ];
services.syncthing = {
enable = true;
user = cfg.user;
group = config.users.users.${cfg.user}.group;
configDir = cfg.home;
guiAddress =
let
listenAddress = with cfg.web; (if (enable && public) then "0.0.0.0" else "127.0.0.1");
in
"${listenAddress}:${builtins.toString cfg.web.port}";
services = {
flatpak.packages = lib.mkIf (config.aux.system.ui.flatpak.enable && cfg.enableTray) [
"io.github.martchus.syncthingtray"
];
syncthing = {
enable = true;
user = cfg.user;
group = config.users.users.${cfg.user}.group;
configDir = cfg.home;
guiAddress =
let
listenAddress = with cfg.web; (if (enable && public) then "0.0.0.0" else "127.0.0.1");
in
"${listenAddress}:${builtins.toString cfg.web.port}";
};
};
systemd.services.syncthing = {

View file

@ -105,7 +105,6 @@ in
gnomeExtensions.appindicator
gnomeExtensions.dash-to-panel
gnomeExtensions.random-wallpaper
gnomeExtensions.syncthing-indicator
];
};