mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Merge pull request #105706 from pacien/ssmtp-config-generator
nixos/ssmtp: fix configuration generator to accomodate ssmtp
This commit is contained in:
commit
b17e9cbb8f
1 changed files with 7 additions and 6 deletions
|
@ -162,15 +162,16 @@ in
|
||||||
(mkIf (cfg.authPassFile != null) { AuthPassFile = cfg.authPassFile; })
|
(mkIf (cfg.authPassFile != null) { AuthPassFile = cfg.authPassFile; })
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.etc."ssmtp/ssmtp.conf".source =
|
# careful here: ssmtp REQUIRES all config lines to end with a newline char!
|
||||||
let
|
environment.etc."ssmtp/ssmtp.conf".text = with generators; toKeyValue {
|
||||||
toStr = value:
|
mkKeyValue = mkKeyValueDefault {
|
||||||
|
mkValueString = value:
|
||||||
if value == true then "YES"
|
if value == true then "YES"
|
||||||
else if value == false then "NO"
|
else if value == false then "NO"
|
||||||
else builtins.toString value
|
else mkValueStringDefault {} value
|
||||||
;
|
;
|
||||||
in
|
} "=";
|
||||||
pkgs.writeText "ssmtp.conf" (concatStringsSep "\n" (mapAttrsToList (key: value: "${key}=${toStr value}") cfg.settings));
|
} cfg.settings;
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.ssmtp];
|
environment.systemPackages = [pkgs.ssmtp];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue