dot_testing/modules/mail.nix

38 lines
1.0 KiB
Nix
Raw Normal View History

2023-07-08 14:22:13 -05:00
{ config, lib, pkgs, ... }:
2023-07-07 23:44:40 -05:00
let
release = "nixos-23.05";
cfg = config.services.nixosmail;
in {
options.services.nixosmail = {
2023-07-08 14:22:13 -05:00
enable = lib.mkEnableOption "NixOS mail server";
2023-07-07 23:44:40 -05:00
};
imports = [
(builtins.fetchTarball {
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/${release}/nixos-mailserver-${release}.tar.gz";
# This hash needs to be updated
sha256 = "1ngil2shzkf61qxiqw11awyl81cr7ks2kv3r3k243zz7v2xakm5c";
})
];
2023-07-08 14:22:13 -05:00
config = lib.mkIf cfg.enable {
2023-07-07 23:44:40 -05:00
mailserver = {
enable = true;
fqdn = "mail.beepboop.systems";
domains = [ "beepboop.systems" ];
loginAccounts = {
"ryan@beepboop.systems" = {
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' > /hashed/password/file/location
hashedPasswordFile = "/etc/ryan-beepboop-systemsuser-pass";
aliases = [
"info@beepboop.systems"
"postmaster@beepboop.systems"
];
};
};
certificateScheme = "acme-nginx";
};
};
}