Skip to content

Instantly share code, notes, and snippets.

@HanEmile
Created January 17, 2023 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HanEmile/85d087b829b45ac89ce1c194d5b027cb to your computer and use it in GitHub Desktop.
Save HanEmile/85d087b829b45ac89ce1c194d5b027cb to your computer and use it in GitHub Desktop.
minimal simple-nixos-mailserver config
{ 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 = {
"mail@emile.space" = {
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