nixos/hound: restart service on changes (#377611)
This commit is contained in:
commit
a9ac4deac7
@ -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;
|
||||
|
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user