Created
January 17, 2023 09:00
-
-
Save HanEmile/85d087b829b45ac89ce1c194d5b027cb to your computer and use it in GitHub Desktop.
minimal simple-nixos-mailserver config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, ... }: | |
let | |
release = "nixos-21.11"; | |
in { | |
imports = [ | |
(builtins.fetchTarball { | |
# Pick a commit from the branch you are interested in | |
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/${release}/nixos-mailserver-${release}.tar.gz"; | |
# And set its hash | |
sha256 = "1i56llz037x416bw698v8j6arvv622qc0vsycd20lx3yx8n77n44"; | |
}) | |
]; | |
mailserver = { | |
enable = true; | |
fqdn = "mail.emile.space"; | |
domains = [ "emile.space" ]; | |
# A list of all login accounts. To create the password hashes, use | |
# nix run nixpkgs.apacheHttpd -c htpasswd -nbB "" "super secret password" | cut -d: -f2 | |
loginAccounts = { | |
"[email protected]" = { | |
hashedPasswordFile = "/etc/nixos/keys/mail"; | |
aliases = ["@emile.space"]; | |
}; | |
}; | |
localDnsResolver = false; | |
# Use Let's Encrypt certificates. Note that this needs to set up a stripped | |
# down nginx and opens port 80. | |
certificateScheme = 3; | |
# Enable IMAP and POP3 | |
enableImap = true; | |
enablePop3 = true; | |
enableSubmission = true; | |
enableImapSsl = true; | |
enablePop3Ssl = true; | |
enableSubmissionSsl = true; | |
enableManageSieve = true; | |
virusScanning = false; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment