3 path = "../../opendmarc";
6 inputs.nix-lib.url = "github:NixOS/nixpkgs";
8 description = "Private configuration for opendmarc";
9 outputs = { self, nix-lib, opendmarc }:
11 cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') {
12 users.users."${config.services.opendmarc.user}".extraGroups = [ "keys" ];
13 systemd.services.opendmarc.serviceConfig.Slice = "mail.slice";
14 services.opendmarc = {
16 socket = "local:${config.myServices.mail.milters.sockets.opendmarc}";
17 configFile = pkgs.writeText "opendmarc.conf" ''
20 FailureReportsBcc postmaster@immae.eu
21 FailureReportsOnNone true
22 FailureReportsSentBy postmaster@immae.eu
23 IgnoreAuthenticatedClients true
24 IgnoreHosts ${config.secrets.fullPaths."opendmarc/ignore.hosts"}
30 group = config.services.postfix.group;
32 services.filesWatcher.opendmarc = {
35 config.secrets.fullPaths."opendmarc/ignore.hosts"
40 dest = "opendmarc/ignore.hosts";
41 user = config.services.opendmarc.user;
42 group = config.services.opendmarc.group;
45 mxes = lib.attrsets.filterAttrs
49 builtins.concatStringsSep "\n" ([
50 config.myEnv.mail.dmarc.ignore_hosts
51 ] ++ lib.mapAttrsToList (n: v: v.fqdn) mxes);
57 { nixosModules = opendmarc.nixosModules or {} // nix-lib.lib.genAttrs ["eldiron" "backup-2"] cfg; };