about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authortilpner <git@tilpner.com>2023-09-04 01:02:57 +0200
committerYt <happysalada@tuta.io>2023-09-04 20:26:02 +0000
commit6e8591a8d17cbd3a2142b1b2db7959ad55c1c3dc (patch)
treee0076cdf356819d469d05f9c968e93b88f08dfeb /nixos
parentca6ed1cc8d4771d5d115d16b9f67157c658e36d8 (diff)
nixos/mimir: add extraFlags option
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/monitoring/mimir.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/services/monitoring/mimir.nix b/nixos/modules/services/monitoring/mimir.nix
index edca9b7be4ff0..6ed139b229748 100644
--- a/nixos/modules/services/monitoring/mimir.nix
+++ b/nixos/modules/services/monitoring/mimir.nix
@@ -32,11 +32,21 @@ in {
       type = types.package;
       description = lib.mdDoc ''Mimir package to use.'';
     };
+
+    extraFlags = mkOption {
+      type = types.listOf types.str;
+      default = [];
+      example = [ "--config.expand-env=true" ];
+      description = lib.mdDoc ''
+        Specify a list of additional command line flags,
+        which get escaped and are then passed to Mimir.
+      '';
+    };
   };
 
   config = mkIf cfg.enable {
     # for mimirtool
-    environment.systemPackages = [ pkgs.mimir ];
+    environment.systemPackages = [ cfg.package ];
 
     assertions = [{
       assertion = (
@@ -60,7 +70,7 @@ in {
                else cfg.configFile;
       in
       {
-        ExecStart = "${cfg.package}/bin/mimir --config.file=${conf}";
+        ExecStart = "${cfg.package}/bin/mimir --config.file=${conf} ${escapeShellArgs cfg.extraFlags}";
         DynamicUser = true;
         Restart = "always";
         ProtectSystem = "full";