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:
@@ -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}
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user