···
1
-
{ config, lib, pkgs, ... }:
1
+
{ config, lib, pkgs, utils, ... }:
inherit (lib) maintainers;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) literalExpression mkEnableOption mkOption mkPackageOption;
inherit (lib.types) bool enum nullOr port str submodule;
8
+
inherit (utils) genJqSecretsReplacementSnippet;
cfg = config.services.scrutiny;
# Define the settings format used for this program
···
Scrutiny settings to be rendered into the configuration file.
See <https://github.com/AnalogJ/scrutiny/blob/master/example.scrutiny.yaml>.
41
+
Options containing secret data should be set to an attribute set
42
+
containing the attribute `_secret`. This attribute should be a string
43
+
or structured JSON with `quote = false;`, pointing to a file that
44
+
contains the value the option should be set to.
···
Collector settings to be rendered into the collector configuration file.
See <https://github.com/AnalogJ/scrutiny/blob/master/example.collector.yaml>.
140
+
Options containing secret data should be set to an attribute set
141
+
containing the attribute `_secret`. This attribute should be a string
142
+
or structured JSON with `quote = false;`, pointing to a file that
143
+
contains the value the option should be set to.
···
SCRUTINY_WEB_DATABASE_LOCATION = "/var/lib/scrutiny/scrutiny.db";
SCRUTINY_WEB_SRC_FRONTEND_PATH = "${cfg.package}/share/scrutiny";
192
+
${genJqSecretsReplacementSnippet cfg.settings "/run/scrutiny/config.yaml"}
if "${lib.getExe pkgs.curl}" --fail --silent --head "http://${cfg.settings.web.listen.host}:${toString cfg.settings.web.listen.port}" >/dev/null; then
···
194
-
ExecStart = "${getExe cfg.package} start --config ${settingsFormat.generate "scrutiny.yaml" cfg.settings}";
208
+
ExecStart = "${getExe cfg.package} start --config /run/scrutiny/config.yaml";
210
+
RuntimeDirectory = "scrutiny";
211
+
RuntimeDirectoryMode = "0700";
StateDirectory = "scrutiny";
StateDirectoryMode = "0750";
···
COLLECTOR_API_ENDPOINT = cfg.collector.settings.api.endpoint;
236
+
${genJqSecretsReplacementSnippet cfg.collector.settings "/run/scrutiny-collector/config.yaml"}
221
-
ExecStart = "${getExe cfg.collector.package} run --config ${settingsFormat.generate "scrutiny-collector.yaml" cfg.collector.settings}";
240
+
ExecStart = "${getExe cfg.collector.package} run --config /run/scrutiny-collector/config.yaml";
241
+
RuntimeDirectory = "scrutiny-collector";
242
+
RuntimeDirectoryMode = "0700";
startAt = cfg.collector.schedule;