voxtype: restart service when configuration changes

Add the rendered config path to X-Restart-Triggers so the service restarts
whenever the configuration changes.
This commit is contained in:
Austin Horstman
2026-06-09 07:49:19 -05:00
parent df39142474
commit 449012836e
2 changed files with 4 additions and 0 deletions
+3
View File
@@ -129,6 +129,9 @@ in
Unit = {
Description = "Voxtype speech-to-text daemon";
PartOf = [ "default.target" ];
X-Restart-Triggers = mkIf (cfg.settings != { }) [
"${config.xdg.configFile."voxtype/config.toml".source}"
];
}
// optionalAttrs (cfg.loadModels != [ ]) {
Wants = [ "voxtype-model-loader.service" ];
@@ -29,6 +29,7 @@
assertFileRegex "$serviceFile" 'Environment=PATH=.*/bin'
assertFileRegex "$serviceFile" 'Environment=WAYLAND_DISPLAY=wayland-1'
assertFileRegex "$serviceFile" 'Environment=VOXTYPE_TEST_ENV=1'
assertFileRegex "$serviceFile" 'X-Restart-Triggers=/nix/store/.*-voxtype-config.toml'
assertFileContent "$configFile" ${./expected-config.toml}
'';