2.home-manager/tests/modules/services/syncthing/linux/gui-address-init.nix
Austin Horstman 4883af6edb syncthing: avoid init for default gui address
The gui address option always has a default value, so #8644 ended up
making syncthing-init run for every enabled Syncthing setup.

Treat the default gui address as unset for updater purposes so the init
unit is only generated when Home Manager is actually managing Syncthing
configuration. Add regression tests for the default and explicit
guiAddress cases.
2026-04-26 19:44:29 -05:00

16 lines
534 B
Nix

{
services.syncthing = {
enable = true;
guiAddress = "127.0.0.1:8385";
};
nmt.script = ''
serviceFile=home-files/.config/systemd/user/syncthing-init.service
assertFileExists "$serviceFile"
assertFileExists home-files/.config/systemd/user/default.target.wants/syncthing-init.service
assertFileContains "$serviceFile" "ExecStart="
updateScript=$(grep -o '/nix/store/[^ ]*-merge-syncthing-config' "$TESTED/$serviceFile")
assertFileContains "$updateScript" "127.0.0.1:8385/rest/config/gui"
'';
}