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

68 lines
1.5 KiB
Nix
Raw Permalink 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";
2022-12-10 06:15:15 +00:00
branch = "22.11";
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-11-06 09:33:56 +00:00
htop vim git
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}";
2022-06-24 05:46:52 +00:00
aliases = [ "@${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
2021-11-06 09:27:55 +00:00
system.stateVersion = "21.05";
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
}