nixos-config/config/host-config/france/webmail.nix

101 lines
2.5 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
hostname = config.instance.hostname;
domain-name = config.instance.local-domain;
site-name = config.instance.local-site;
secrets = config.fudo.secrets.host-secrets.${hostname};
static = config.fudo.static;
mail-hostname = config.france.webmail.mail-server;
db-host = config.france.webmail.database.hostname;
db-passwd = pkgs.lib.fudo.passwd.random-passwd-file "webmail" 40;
in {
options.fudo.france.webmail = with types; {
mail-server = mkOption {
type = str;
description = "Mail server to use for webmail.";
};
database = {
hostname = mkOption {
type = str;
description = "PostgreSQL server.";
};
};
};
config.fudo = {
webmail = {
enable = true;
sites = {
"webmail.fudo.link" = {
title = "Fudo Link Webmail";
favicon = "${static}/fudo.link/favicon.ico";
mail-server = mail-hostname;
domain = "fudo.link";
edit-mode = "Plain";
layout-mode = "bottom";
database = {
hostname = db-host;
password-file = db-passwd;
};
};
"webmail.test.fudo.org" = {
title = "Fudo Webmail";
favicon = "${static}/fudo.org/favicon.ico";
mail-server = mail-hostname;
domain = "fudo.org";
edit-mode = "Plain";
database = {
hostname = db-host;
password-file = db-passwd;
};
};
"webmail.fudo.org" = {
title = "Fudo Webmail";
favicon = "${static}/fudo.org/favicon.ico";
mail-server = mail-hostname;
domain = "fudo.org";
edit-mode = "Plain";
database = {
hostname = db-host;
password-file = db-passwd;
};
};
"webmail.test.selby.ca" = {
title = "Selby Webmail";
favicon = "${static}/selby.ca/favicon.ico";
mail-server = mail-hostname;
domain = "selby.ca";
database = {
hostname = db-host;
password-file = db-passwd;
};
};
"webmail.selby.ca" = {
title = "Selby Webmail";
favicon = "${static}/selby.ca/favicon.ico";
mail-server = mail-hostname;
domain = "selby.ca";
database = {
hostname = db-host;
password-file = db-passwd;
};
};
};
};
};
}