Skip to content

Instantly share code, notes, and snippets.

@WolfangAukang
Created March 24, 2022 21:53

Revisions

  1. WolfangAukang created this gist Mar 24, 2022.
    33 changes: 33 additions & 0 deletions configuration.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    { modulesPath, pkgs, ... }: {

    # AWS Defaults
    imports = [ "${modulesPath}/virtualisation/amazon-image.nix" ];
    ec2.hvm = true;

    # Server
    networking.hostName = "nixos-testing";
    boot.cleanTmpDir = true;

    # Applications
    environment.systemPackages = with pkgs; [
    mailutils
    ];

    # Mail
    services.postfix = {
    enable = true;
    # Using password and tls setup with postmap
    config = {
    smtp_sasl_auth_enable = "yes";
    smtp_sasl_security_options = "noanonymous";
    smtp_sasl_password_maps = "hash:/etc/postfix/saslpasswd";
    smtp_always_send_ehlo = "yes";
    smtp_use_tls = "yes";
    smtp_tls_security_level = "encrypt";
    smtp_tls_note_starttls_offer = "yes";
    smtp_tls_policy_maps = "hash:/etc/postfix/tls_policy";
    };
    relayHost = "email-smtp.us-east-1.amazonaws.com";
    relayPort = 587;
    };
    }