diff --git a/nixos/modules/services/monitoring/alloy.nix b/nixos/modules/services/monitoring/alloy.nix index fe0ed2cab8b3..e9d850b85a27 100644 --- a/nixos/modules/services/monitoring/alloy.nix +++ b/nixos/modules/services/monitoring/alloy.nix @@ -48,6 +48,15 @@ in ''; }; + environmentFile = lib.mkOption { + type = with lib.types; nullOr path; + default = null; + example = "/run/secrets/alloy.env"; + description = '' + EnvironmentFile as defined in {manpage}`systemd.exec(5)`. + ''; + }; + extraFlags = lib.mkOption { type = with lib.types; listOf str; default = [ ]; @@ -84,6 +93,7 @@ in StateDirectory = "alloy"; WorkingDirectory = "%S/alloy"; Type = "simple"; + EnvironmentFile = lib.mkIf (cfg.environmentFile != null) [ cfg.environmentFile ]; }; }; };