mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
nixos/opendkim: put config file under standard location
(cherry picked from commit f497159195
)
This commit is contained in:
parent
ab0bfdbfe2
commit
eacd58dfea
@ -12,6 +12,8 @@ let
|
|||||||
"-s" cfg.selector
|
"-s" cfg.selector
|
||||||
] ++ lib.optionals (cfg.configFile != null) [ "-x" cfg.configFile ];
|
] ++ lib.optionals (cfg.configFile != null) [ "-x" cfg.configFile ];
|
||||||
|
|
||||||
|
configFile = pkgs.writeText "opendkim.conf"
|
||||||
|
(lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.settings));
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
(lib.mkRenamedOptionModule [ "services" "opendkim" "keyFile" ] [ "services" "opendkim" "keyPath" ])
|
(lib.mkRenamedOptionModule [ "services" "opendkim" "keyFile" ] [ "services" "opendkim" "keyPath" ])
|
||||||
@ -93,10 +95,14 @@ in {
|
|||||||
opendkim.gid = config.ids.gids.opendkim;
|
opendkim.gid = config.ids.gids.opendkim;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.opendkim ];
|
environment = {
|
||||||
|
etc = lib.mkIf (cfg.settings != { }) {
|
||||||
|
"opendkim/opendkim.conf".source = configFile;
|
||||||
|
};
|
||||||
|
systemPackages = [ pkgs.opendkim ];
|
||||||
|
};
|
||||||
|
|
||||||
services.opendkim.configFile = lib.mkIf (cfg.settings != { }) (pkgs.writeText "opendkim.conf"
|
services.opendkim.configFile = lib.mkIf (cfg.settings != { }) configFile;
|
||||||
(lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} ${value}") cfg.settings)));
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '${cfg.keyPath}' - ${cfg.user} ${cfg.group} - -"
|
"d '${cfg.keyPath}' - ${cfg.user} ${cfg.group} - -"
|
||||||
|
Loading…
Reference in New Issue
Block a user