summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2025-01-28 19:41:12 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2025-01-30 17:19:42 +0100
commitf54ca85ca8cc16624a2a63d822a544b03d860e13 (patch)
tree7e3745387ea4bf45c9184508742659064d22245c
parentMerge: [Backport release-24.11] epson-escpr2: 1.2.25 -> 1.2.26 (#377978) (diff)
downloadnixpkgs-f54ca85ca8cc16624a2a63d822a544b03d860e13.tar.gz
nixos/hound: restart service on config changes
I expect config changes to be observable in the running service after `sudo nixos-rebuild switch`. hound doesn't seem to support *reload*, so use restart instead. (cherry picked from commit 56bfc5782d9c61b2c542abbfc08a38533fa18148)
-rw-r--r--nixos/modules/services/search/hound.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/nixos/modules/services/search/hound.nix b/nixos/modules/services/search/hound.nix
index 33ade1b963b4..0d76db97759a 100644
--- a/nixos/modules/services/search/hound.nix
+++ b/nixos/modules/services/search/hound.nix
@@ -7,6 +7,13 @@
let
cfg = config.services.hound;
settingsFormat = pkgs.formats.json { };
+ houndConfigFile = pkgs.writeTextFile {
+ name = "hound-config";
+ text = builtins.toJSON cfg.settings;
+ checkPhase = ''
+ ${cfg.package}/bin/houndd -check-conf -conf $out
+ '';
+ };
in
{
imports = [
@@ -96,13 +103,7 @@ in
};
};
- environment.etc."hound/config.json".source = pkgs.writeTextFile {
- name = "hound-config";
- text = builtins.toJSON cfg.settings;
- checkPhase = ''
- ${cfg.package}/bin/houndd -check-conf -conf $out
- '';
- };
+ environment.etc."hound/config.json".source = houndConfigFile;
services.hound.settings = {
dbpath = "${config.services.hound.home}/data";
@@ -112,6 +113,7 @@ in
description = "Hound Code Search";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
+ restartTriggers = [ houndConfigFile ];
serviceConfig = {
User = cfg.user;
Group = cfg.group;