···
freeformType = attrsOf str;
database_path = lib.mkOption {
66
-
default = "osquery/osquery.db";
66
+
default = "/var/lib/osquery/osquery.db";
68
-
description = "Path used for the database file, relative to /var/lib/.";
69
+
Path used for the database file.
72
+
If left as the default value, this directory will be automatically created before the
73
+
service starts, otherwise you are responsible for ensuring the directory exists with
74
+
the appropriate ownership and permissions.
logger_path = lib.mkOption {
72
-
default = "osquery";
79
+
default = "/var/log/osquery";
74
-
description = "Base directory used for logging, relative to /var/log/.";
82
+
Base directory used for logging.
85
+
If left as the default value, this directory will be automatically created before the
86
+
service starts, otherwise you are responsible for ensuring the directory exists with
87
+
the appropriate ownership and permissions.
default = "/run/osquery/osqueryd.pid";
···
ExecStart = "${pkgs.osquery}/bin/osqueryd --flagfile ${flagfile}";
PIDFile = cfg.flags.pidfile;
99
-
LogsDirectory = cfg.flags.logger_path;
100
-
StateDirectory = dirname cfg.flags.database_path;
113
+
LogsDirectory = lib.mkIf (cfg.flags.logger_path == "/var/log/osquery") [ "osquery" ];
114
+
StateDirectory = lib.mkIf (cfg.flags.database_path == "/var/lib/osquery/osquery.db") [ "osquery" ];
wantedBy = [ "multi-user.target" ];