nixos-config

NixOS configs for my systems
Log | Files | Refs

commit abe0ef21cf91e3a638f899d5091e82bc4c4fdee5
parent 2b873d6e9db9f8536a96298f42455295f8fa7204
Author: vin <vin@vineetk.net>
Date:   Sun,  2 Mar 2025 02:01:28 -0500

saklas: try using the nixos-mailserver flake

Diffstat:
Mflake.nix | 5++++-
Mhosts/saklas/default.nix | 2+-
Ahosts/saklas/mail.nix | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/flake.nix b/flake.nix @@ -15,9 +15,11 @@ url = "github:everblush/gtk"; inputs.nixpkgs.follows = "nixpkgs"; }; + + simple-nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-24.11"; }; - outputs = { self, home-manager, nixpkgs, nixpkgs-stable, everblush-gtk, ... }@inputs: { + outputs = { self, home-manager, nixpkgs, nixpkgs-stable, everblush-gtk, simple-nixos-mailserver, ... }@inputs: { # TODO: deduplicate this nixosConfigurations = { demiurge = nixpkgs.lib.nixosSystem { @@ -61,6 +63,7 @@ specialArgs = inputs; modules = [ ./hosts/saklas + simple-nixos-mailserver.nixosModules.default ./hosts/saklas/mail.nix ]; }; }; diff --git a/hosts/saklas/default.nix b/hosts/saklas/default.nix @@ -88,7 +88,7 @@ }; services = { - # reverse proxy + # web server and reverse proxy nginx = { enable = false; diff --git a/hosts/saklas/mail.nix b/hosts/saklas/mail.nix @@ -0,0 +1,59 @@ +{ + mailserver = { + enable = true; + fqdn = "mail.vineetk.net"; + domains = [ "vineetk.net" "vinbiz.ca" "13f0.net" ]; + + # A list of all login accounts. To create the password hashes, use + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' + loginAccounts = { + "vineet@vineetk.net" = { + hashedPassword = "$2b$05$7chAoNcCtw8ajVQYjmb7T.JLcOjtlVsS/LipIvc3LY4/qUPrFTP/."; + aliases = ["@vineetk.net"]; + }; + + "kar@13f0.net" = { + hashedPassword = "$2b$05$w0rQk32VTQ8YMPQa.Mb28eX8zmYpDqI9FMPShQ7o2tYVzpbtvEyPq"; + aliases = ["@13f0.net"]; + sieveScript = '' +require [ "fileinto", "mailbox" ]; + +if address :matches [ "to", "cc" ] "announce@openbsd.org" { + fileinto :create "openbsd_announce"; + stop; +} +if address :matches [ "to", "cc" ] "arm@openbsd.org" { + fileinto :create "openbsd_arm"; + stop; +} +if address :matches [ "to", "cc" ] "misc@openbsd.org" { + fileinto :create "openbsd_misc"; + stop; +} +if address :matches [ "to", "cc" ] "misc@opensmtpd.org" { + fileinto :create "opensmtpd_misc"; + stop; +} +if address :matches [ "to", "cc" ] "oss-security@lists.openwall.com" { + fileinto :create "oss_security"; + stop; +} +if address :matches [ "to", "cc" ] "tuhs@tuhs.org" { + fileinto :create "tuhs"; + stop; +} + ''; + }; + + "vineet@vinbiz.ca" = { + hashedPassword = "$2b$05$lyCFvoxfoJX8jtI3FsePLenhcIn.hqN53twq/zJ316f4WHQJeUji6"; + aliases = ["postmaster@vinbiz.ca"]; + }; + "suresh@vinbiz.ca".hashedPassword = "$2b$05$Vpqk62qIbRsFQipSd2aA0.EqL011nSmhA6VD.YjjfoYbO3zZVybDS"; + "revathy@vinbiz.ca".hashedPassword = "$2b$05$RkABB76JTCNa0cotOfS28..mJME7a/A4gaTRpZnSdTJi3wr2X3t.C"; + "suren@vinbiz.ca".hashedPassword = "$2b$05$.VTHKaBu0JQf2MpLNa7GXeliyZxOdXms59VslMmEjnu.IOzjVgHzy"; + }; + + certificateScheme = "acme"; + }; +}