Unverified Commit a9ac4dea authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

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

parents 09215356 5555b70e
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -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;
+9 −11
Original line number Diff line number Diff line
@@ -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 = {