config

NixOS config
Log | Files | Refs | README | LICENSE

default.nix (964B) - Raw


      1 {
      2   config,
      3   lib,
      4   myData,
      5   pkgs,
      6   ...
      7 }:
      8 {
      9   options.mj.services.postfix = with lib.types; {
     10     enable = lib.mkEnableOption "Enable postfix";
     11     saslPasswdPath = lib.mkOption { type = path; };
     12   };
     13 
     14   config = lib.mkIf config.mj.services.postfix.enable {
     15     environment.systemPackages = [ pkgs.mailutils ];
     16 
     17     services.postfix = {
     18       enable = true;
     19       enableSmtp = true;
     20       settings.main = {
     21         mynetworks = [
     22           "127.0.0.1/8"
     23           "[::ffff:127.0.0.0]/104"
     24           "[::1]/128"
     25           myData.subnets.tailscale.cidr
     26         ];
     27         myhostname = "relay.jakstys.lt";
     28         mydestination = "";
     29         smtpd_relay_restrictions = "permit_mynetworks, reject";
     30         smtpd_recipient_restrictions = "permit_mynetworks, reject_unauth_destination";
     31         smtp_tls_security_level = "may";
     32         smtpd_helo_required = "yes";
     33         disable_vrfy_command = "yes";
     34         header_size_limit = "4096000";
     35       };
     36     };
     37   };
     38 }