mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
nixos/stalwart-mail: support adding secrets (#380588)
This commit is contained in:
commit
ddef0335cb
1 changed files with 16 additions and 0 deletions
|
@ -53,6 +53,21 @@ in
|
||||||
Data directory for stalwart
|
Data directory for stalwart
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
credentials = lib.mkOption {
|
||||||
|
description = ''
|
||||||
|
Credentials envs used to configure Stalwart-Mail secrets.
|
||||||
|
These secrets can be accessed in configuration values with
|
||||||
|
the macros such as
|
||||||
|
`%{file:/run/credentials/stalwart-mail.service/VAR_NAME}%`.
|
||||||
|
'';
|
||||||
|
type = lib.types.attrsOf lib.types.str;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
user_admin_password = "/run/keys/stalwart_admin_password";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -149,6 +164,7 @@ in
|
||||||
""
|
""
|
||||||
"${cfg.package}/bin/stalwart-mail --config=${configFile}"
|
"${cfg.package}/bin/stalwart-mail --config=${configFile}"
|
||||||
];
|
];
|
||||||
|
LoadCredential = lib.mapAttrsToList (key: value: "${key}:${value}") cfg.credentials;
|
||||||
|
|
||||||
StandardOutput = "journal";
|
StandardOutput = "journal";
|
||||||
StandardError = "journal";
|
StandardError = "journal";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue