mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
nixos/tempo: add extraFlags
option
Main use-case for me is to specify `-config.expand-env=true` which allows me inject secrets via systemd's environment file mechanism[1] like this: storage.trace.s3 = { /* all the other stuff */ secret_key = "\${GARAGE_SECRET_KEY}"; }; [1] https://grafana.com/docs/tempo/latest/configuration/#use-environment-variables-in-the-configuration
This commit is contained in:
parent
afde5d87aa
commit
10c6be32e4
@ -27,6 +27,18 @@ in {
|
||||
Specify a path to a configuration file that Tempo should use.
|
||||
'';
|
||||
};
|
||||
|
||||
extraFlags = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
example = lib.literalExpression
|
||||
''
|
||||
[ "-config.expand-env=true" ]
|
||||
'';
|
||||
description = lib.mdDoc ''
|
||||
Additional flags to pass to the `ExecStart=` in `tempo.service`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
@ -54,7 +66,7 @@ in {
|
||||
else cfg.configFile;
|
||||
in
|
||||
{
|
||||
ExecStart = "${pkgs.tempo}/bin/tempo --config.file=${conf}";
|
||||
ExecStart = "${pkgs.tempo}/bin/tempo --config.file=${conf} ${lib.escapeShellArgs cfg.extraFlags}";
|
||||
DynamicUser = true;
|
||||
Restart = "always";
|
||||
ProtectSystem = "full";
|
||||
|
Loading…
Reference in New Issue
Block a user