nixos/hound: restart service on changes (#377611)

This commit is contained in:
Franz Pletz 2025-01-29 09:52:05 +01:00 committed by GitHub
commit a9ac4deac7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 18 deletions

View File

@ -7,6 +7,13 @@
let
cfg = config.services.hound;
settingsFormat = pkgs.formats.json { };
houndConfigFile = pkgs.writeTextFile {
name = "hound-config.json";
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;

View File

@ -11,17 +11,15 @@ import ./make-test-python.nix (
{
services.hound = {
enable = true;
config = ''
{
"max-concurrent-indexers": 1,
"dbpath": "/var/lib/hound/data",
"repos": {
"nix": {
"url": "file:///var/lib/hound/my-git"
}
}
}
'';
settings = {
"max-concurrent-indexers" = 1;
"dbpath" = "/var/lib/hound/data";
"repos" = {
"nix" = {
"url" = "file:///var/lib/hound/my-git";
};
};
};
};
systemd.services.houndseed = {