1
0
Fork 0
mail.dumpstack.io/configuration.nix

69 lines
1.5 KiB
Nix
Raw Normal View History

2019-02-02 19:07:01 +00:00
{ config, pkgs, ... }:
let
secrets = import ./secrets.nix;
hostname = "mail-dumpstack-io";
domain = "dumpstack.io";
branch = "20.09";
2019-02-02 19:07:01 +00:00
in {
imports = [
./hardware-configuration.nix
(builtins.fetchTarball {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-${branch}/nixos-mailserver-nixos-${branch}.tar.gz";
2019-02-02 19:07:01 +00:00
})
];
users.extraUsers.root = {
openssh.authorizedKeys.keys = [ secrets.pubkey ];
};
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/vda";
networking.hostName = hostname;
2019-02-02 19:07:01 +00:00
networking.firewall.allowedTCPPorts = [ 443 ];
environment.systemPackages = with pkgs; [
2021-02-01 23:17:41 +00:00
htop vim
2019-02-02 19:07:01 +00:00
];
security.acme.acceptTerms = true;
security.acme.certs."mail.${domain}".email = "letsencrypt@${domain}";
2019-02-02 19:07:01 +00:00
mailserver = {
enable = true;
fqdn = "mail.${domain}";
domains = [ "${domain}" ];
2019-02-02 19:07:01 +00:00
loginAccounts = {
"root@${domain}" = {
2019-02-02 19:07:01 +00:00
hashedPassword = "${secrets.mailHashedPassword}";
aliases = secrets.aliases;
catchAll = [ "${domain}" ];
2019-02-02 19:07:01 +00:00
};
};
certificateScheme = 3; # Let's Encrypt
enableImapSsl = true;
};
time.timeZone = "UTC";
services.openssh.enable = true;
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
# read release notes carefully before changing it
system.stateVersion = "20.09";
2019-04-12 17:25:46 +00:00
2019-04-12 17:42:03 +00:00
nix = {
optimise.automatic = true;
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
};
2019-02-02 19:07:01 +00:00
}