Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC]: nixos/opendkim: umask, extraConfig options #78126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 12 additions & 3 deletions nixos/modules/services/mail/opendkim.nix
Expand Up @@ -10,12 +10,15 @@ let

keyFile = "${cfg.keyPath}/${cfg.selector}.private";

cfgCts = optionalString (cfg.umask != null) "UMask ${cfg.umask}\n"
+ optionalString (cfg.extraConfig != null) cfg.extraConfig;

args = [ "-f" "-l"
"-p" cfg.socket
"-d" cfg.domains
"-k" keyFile
"-s" cfg.selector
] ++ optionals (cfg.configFile != null) [ "-x" cfg.configFile ];
] ++ optionals (cfgCts != "") [ "-x" (pkgs.writeText "opendkim.conf" cfgCts)];

in {
imports = [
Expand All @@ -40,6 +43,12 @@ in {
description = "Socket which is used for communication with OpenDKIM.";
};

umask = mkOption {
type = types.nullOr types.str;
default = null;
description = "Umask for socket";
};

user = mkOption {
type = types.str;
default = "opendkim";
Expand Down Expand Up @@ -76,8 +85,8 @@ in {
description = "Selector to use when signing.";
};

configFile = mkOption {
type = types.nullOr types.path;
extraConfig = mkOption {
type = types.nullOr types.lines;
default = null;
description = "Additional opendkim configuration.";
};
Expand Down