nixos/osquery: fix database_path + logger_path opts per systemd docs

nixos/osquery: Update tests with option changes

Changed files
+7 -7
nixos
modules
services
monitoring
tests
+6 -6
nixos/modules/services/monitoring/osquery.nix
···
freeformType = attrsOf str;
options = {
database_path = lib.mkOption {
-
default = "/var/lib/osquery/osquery.db";
+
default = "osquery/osquery.db";
readOnly = true;
-
description = "Path used for the database file.";
-
type = path;
+
description = "Path used for the database file, relative to /var/lib/.";
+
type = nonEmptyStr;
};
logger_path = lib.mkOption {
-
default = "/var/log/osquery";
+
default = "osquery";
readOnly = true;
-
description = "Base directory used for logging.";
-
type = path;
+
description = "Base directory used for logging, relative to /var/log/.";
+
type = nonEmptyStr;
};
pidfile = lib.mkOption {
default = "/run/osquery/osqueryd.pid";
+1 -1
nixos/tests/osquery.nix
···
machine.succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"nullvalue\";' | osqueryi | tee /dev/console | grep -q ${nullvalue}")
# Module creates directories for default database_path and pidfile flag values.
-
machine.succeed("test -d $(dirname ${cfg.flags.database_path})")
+
machine.succeed("test -d $(dirname /var/lib/${cfg.flags.database_path})")
machine.succeed("test -d $(dirname ${cfg.flags.pidfile})")
'';
}