3 url = "https://git.immae.eu/perso/Immae/Config/Nix.git";
5 dir = "flakes/opendmarc";
7 inputs.nixpkgs.url = "github:NixOS/nixpkgs";
9 description = "Private configuration for opendmarc";
10 outputs = { self, nixpkgs, opendmarc }:
12 cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') {
13 users.users."${config.services.opendmarc.user}".extraGroups = [ "keys" ];
14 systemd.services.opendmarc.serviceConfig.Slice = "mail.slice";
15 services.opendmarc = {
17 socket = "local:${config.myServices.mail.milters.sockets.opendmarc}";
18 configFile = pkgs.writeText "opendmarc.conf" ''
21 FailureReportsBcc postmaster@immae.eu
22 FailureReportsOnNone true
23 FailureReportsSentBy postmaster@immae.eu
24 IgnoreAuthenticatedClients true
25 IgnoreHosts ${config.secrets.fullPaths."opendmarc/ignore.hosts"}
31 group = config.services.postfix.group;
33 services.filesWatcher.opendmarc = {
36 config.secrets.fullPaths."opendmarc/ignore.hosts"
41 dest = "opendmarc/ignore.hosts";
42 user = config.services.opendmarc.user;
43 group = config.services.opendmarc.group;
46 mxes = lib.attrsets.filterAttrs
50 builtins.concatStringsSep "\n" ([
51 config.myEnv.mail.dmarc.ignore_hosts
52 ] ++ lib.mapAttrsToList (n: v: v.fqdn) mxes);
58 { nixosModules = opendmarc.nixosModules or {} // nixpkgs.lib.genAttrs ["eldiron" "backup-2"] cfg; };