~aasg/nixexprs

002641b7371bafd080e6526d4de957b80733e8b4 — Aluísio Augusto Silva Gonçalves 9 months ago 56e8ce8
modules/dma: Add configurable sendmail wrapper
1 files changed, 13 insertions(+), 1 deletions(-)

M modules/programs/dma.nix
M modules/programs/dma.nix => modules/programs/dma.nix +13 -1
@@ 115,15 115,27 @@ in
      };

      settings = mkOption {
        type = types.attrs;
        type = with types; attrsOf (oneOf [ bool int str ]);
        description = ''Additional configuration.'';
        default = { };
      };

      setSendmail = mkOption {
        type = types.bool;
        description = "Whether to set the system sendmail to dma.";
        default = true;
      };
    };
  };

  config = mkIf cfg.enable {
    environment.etc."dma/dma.conf" = { text = configText; };
    environment.systemPackages = [ package ];
    services.mail.sendmailSetuidWrapper = mkIf cfg.setSendmail {
      program = "sendmail";
      source = "${package}/bin/dma";
      setuid = false;
      setgid = false;
    };
  };
}