Merge pull request #231096 from kai-tub/vector/add-pkg-opt

vector: add `package` Option
This commit is contained in:
Martin Weinelt 2023-05-11 22:10:20 +02:00 committed by GitHub
commit 3c09f66193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,8 @@ in
options.services.vector = {
enable = mkEnableOption (lib.mdDoc "Vector");
package = mkPackageOptionMD pkgs "vector" { };
journaldAccess = mkOption {
type = types.bool;
default = false;
@ -47,7 +49,7 @@ in
'';
in
{
ExecStart = "${pkgs.vector}/bin/vector --config ${validateConfig conf}";
ExecStart = "${getExe cfg.package} --config ${validateConfig conf}";
DynamicUser = true;
Restart = "no";
StateDirectory = "vector";

View file

@ -31,7 +31,7 @@ with pkgs.lib;
# ensure vector is forwarding the messages appropriately
testScript = ''
machine.wait_for_unit("vector.service")
machine.succeed("test -f /var/lib/vector/logs.log")
machine.wait_for_file("/var/lib/vector/logs.log")
'';
};
}