mirror of
https://codeberg.org/icewind/prometheus-edge-trigger.git
synced 2026-06-03 18:24:10 +02:00
nixos: load token from systemd credentials
This commit is contained in:
parent
e01a0f76f5
commit
1c37a3195e
1 changed files with 4 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ with lib; let
|
||||||
prometheus.url = cfg.prometheusAddress;
|
prometheus.url = cfg.prometheusAddress;
|
||||||
mqtt = {
|
mqtt = {
|
||||||
inherit (cfg.mqtt) host username;
|
inherit (cfg.mqtt) host username;
|
||||||
password_file = cfg.mqtt.passwordFile;
|
password_file = "$CREDENTIALS_DIRECTORY/mqtt_password";
|
||||||
};
|
};
|
||||||
trigger =
|
trigger =
|
||||||
map (trigger: {
|
map (trigger: {
|
||||||
|
|
@ -147,6 +147,9 @@ in {
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${cfg.package}/bin/prometheus-edge-trigger ${configFile}";
|
ExecStart = "${cfg.package}/bin/prometheus-edge-trigger ${configFile}";
|
||||||
|
LoadCredential = [
|
||||||
|
"mqtt_password:${cfg.mqtt.passwordFile}"
|
||||||
|
];
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue