mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 22:43:01 +00:00
nixos/opendkim: add expandable settings option
(cherry picked from commit 1414b222f5
)
This commit is contained in:
parent
68fb052050
commit
ab0bfdbfe2
@ -64,10 +64,19 @@ in {
|
||||
description = "Selector to use when signing.";
|
||||
};
|
||||
|
||||
# TODO: deprecate this?
|
||||
configFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
description = "Additional opendkim configuration.";
|
||||
description = "Additional opendkim configuration as a file.";
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; submodule {
|
||||
freeformType = attrsOf str;
|
||||
};
|
||||
default = { };
|
||||
description = "Additional opendkim configuration";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -86,6 +95,9 @@ in {
|
||||
|
||||
environment.systemPackages = [ pkgs.opendkim ];
|
||||
|
||||
services.opendkim.configFile = lib.mkIf (cfg.settings != { }) (pkgs.writeText "opendkim.conf"
|
||||
(lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.settings)));
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d '${cfg.keyPath}' - ${cfg.user} ${cfg.group} - -"
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user