3 path = "../../opendmarc";
6 inputs.nix-lib.url = "github:NixOS/nixpkgs";
8 # Necessary for dependencies
9 inputs.nixpkgs.follows = "opendmarc/nixpkgs";
11 description = "Private configuration for opendmarc";
12 outputs = { self, nix-lib, opendmarc, nixpkgs }:
14 cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') {
15 users.users."${config.services.opendmarc.user}".extraGroups = [ "keys" ];
16 systemd.services.opendmarc.serviceConfig.Slice = "mail.slice";
17 services.opendmarc = {
19 socket = "local:${config.myServices.mail.milters.sockets.opendmarc}";
20 configFile = pkgs.writeText "opendmarc.conf" ''
23 FailureReportsBcc postmaster@immae.eu
24 FailureReportsOnNone true
25 FailureReportsSentBy postmaster@immae.eu
26 IgnoreAuthenticatedClients true
27 IgnoreHosts ${config.secrets.fullPaths."opendmarc/ignore.hosts"}
33 group = config.services.postfix.group;
35 services.filesWatcher.opendmarc = {
38 config.secrets.fullPaths."opendmarc/ignore.hosts"
43 dest = "opendmarc/ignore.hosts";
44 user = config.services.opendmarc.user;
45 group = config.services.opendmarc.group;
48 mxes = lib.attrsets.filterAttrs
52 builtins.concatStringsSep "\n" ([
53 config.myEnv.mail.dmarc.ignore_hosts
54 ] ++ lib.mapAttrsToList (n: v: v.fqdn) mxes);
60 { nixosModules = opendmarc.nixosModules or {} // nix-lib.lib.genAttrs ["eldiron" "backup-2"] cfg; };