mailserver and some more rework

nixos-mailserver is the best thing since sliced bread
This commit is contained in:
kat witch 2021-02-22 20:08:15 +00:00 committed by kat
parent fdf7cb9e98
commit 246a3772bf
10 changed files with 62 additions and 13 deletions

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let secrets = (import ../../../../secrets.nix); let secrets = (import ../../../secrets.nix);
in { in {
services.bitwarden_rs = { services.bitwarden_rs = {
enable = true; enable = true;

View file

@ -9,6 +9,7 @@
../../services/nginx.nix ../../services/nginx.nix
./virtualhosts.nix ./virtualhosts.nix
# services # services
./mail.nix
./gitea.nix ./gitea.nix
./nextcloud.nix ./nextcloud.nix
./bitwarden.nix ./bitwarden.nix

View file

@ -1,6 +1,3 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {

View file

@ -0,0 +1,56 @@
{ config, pkgs, ... }:
let sources = (import ../../../nix/sources.nix);
secrets = (import ../../../secrets.nix);
in {
imports = [
sources.nixos-mailserver.outPath
];
mailserver = {
enable = true;
fqdn = "kittywit.ch";
domains = [ "kittywit.ch" ];
# 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 = {
"kat@kittywit.ch" = {
hashedPassword = secrets.hosts.athame.mail.kat.password;
aliases = [
"postmaster@kittywit.ch"
];
# Make this user the catchAll address for domains kittywit.ch and
# example2.com
catchAll = [
"kittywit.ch"
];
};
};
# Extra virtual aliases. These are email addresses that are forwarded to
# loginAccounts addresses.
extraVirtualAliases = {
# address = forward address;
"abuse@kittywit.ch" = "kat@kittywit.ch";
};
# 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;
enableImapSsl = true;
enablePop3Ssl = true;
# Enable the ManageSieve protocol
enableManageSieve = true;
# whether to scan inbound emails for viruses (note that this requires at least
# 1 Gb RAM for the server. Without virus scanning 256 MB RAM should be plenty)
virusScanning = false;
};
}

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let secrets = (import ../../../../secrets.nix); let secrets = (import ../../../secrets.nix);
in { in {
environment.systemPackages = environment.systemPackages =
[ pkgs.arc.pkgs.mx-puppet-discord pkgs.mautrix-whatsapp ]; [ pkgs.arc.pkgs.mx-puppet-discord pkgs.mautrix-whatsapp ];

View file

@ -5,7 +5,7 @@ let
enableACME = true; enableACME = true;
forceSSL = true; forceSSL = true;
}; };
secrets = (import ../../../../secrets.nix); secrets = (import ../../../secrets.nix);
in { in {
services.nginx.virtualHosts = { services.nginx.virtualHosts = {
"kittywit.ch" = { "kittywit.ch" = {

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let secrets = (import ../../../../secrets.nix); let secrets = (import ../../../secrets.nix);
in { in {
services.znc = { services.znc = {
enable = true; enable = true;

View file

@ -1,6 +1,3 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {

View file

@ -1,6 +1,3 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {

View file

@ -28,6 +28,7 @@ in {
pkgs.avidemux pkgs.avidemux
pkgs.vlc pkgs.vlc
pkgs.ffmpeg-full pkgs.ffmpeg-full
pkgs.thunderbird
unstable.syncplay unstable.syncplay
unstable.youtube-dl unstable.youtube-dl
unstable.google-chrome unstable.google-chrome