mail2-nixos-config/variables.nix

68 lines
2.4 KiB
Nix
Raw Normal View History

2019-05-10 23:21:28 +02:00
{ config, lib, pkgs, ... }:
{
options = {
variables = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
config.variables = {
dovecotGroup = "dovecot2";
dovecotUser = "dovecot2";
dovecotAuthSocket = "/run/dovecot2/dovecot-auth";
dovecotLmtpSocket = "/run/dovecot2/dovecot-lmtp";
rspamdMilterSocket = "/run/rspamd/milter";
myFQDN = "${config.networking.hostName}.${config.networking.domain}";
pfadminDataDir = "/var/lib/postfixadmin";
pfaGroup = "pfadmin";
pfaPhpfpmHostPort = "127.0.0.1:9000";
pfaUser = "pfadmin";
pfaDomain = "pfa.${config.variables.myFQDN}";
roundcubeFQDN = config.variables.myFQDN;
roundcubeDataDir = "/var/lib/roundcube";
roundcubePhpfpmHostPort = "127.0.0.1:9001";
roundcubeUser = "roundcube";
roundcubeGroup = "roundcube";
2019-05-10 23:21:28 +02:00
useSSL = false;
vmailBaseDir = "/srv/vmail";
2019-05-10 23:21:28 +02:00
vmailGID = 10000;
vmailGroup = "vmail";
vmailUID = 10000;
vmailUser = "vmail";
postfixadminpkgCacheDir = "/var/cache/postfixadmin";
postfixadminpkg = (pkgs.callPackage ./pkg-postfixadmin.nix {
config = (pkgs.writeText "postfixadmin-config.local.php" ''
<?php
$CONF['configured'] = true;
$CONF['setup_password'] = '!';
$CONF['database_type'] = 'sqlite';
$CONF['database_name'] = '${config.variables.pfadminDataDir}/postfixadmin.db';
$CONF['password_expiration'] = 'NO';
$CONF['encrypt'] = 'dovecot:BLF-CRYPT';
2021-05-21 21:32:16 +02:00
$CONF['dovecotpw'] = "${pkgs.dovecot}/bin/doveadm pw";
2019-05-10 23:21:28 +02:00
$CONF['generate_password'] = 'YES';
$CONF['show_password'] = 'NO';
$CONF['quota'] = 'NO';
$CONF['fetchmail'] = 'NO';
$CONF['recipient_delimiter'] = "+";
$CONF['forgotten_user_password_reset'] = false;
$CONF['forgotten_admin_password_reset'] = false;
$CONF['aliases'] = '0';
$CONF['mailboxes'] = '0';
$CONF['default_aliases'] = array (
'abuse' => '${config.variables.mailAdmin}',
'hostmaster' => '${config.variables.mailAdmin}',
'postmaster' => '${config.variables.mailAdmin}',
'webmaster' => '${config.variables.mailAdmin}'
);
$CONF['footer_text'] = "";
$CONF['footer_link'] = "";
2019-06-13 14:52:17 +02:00
$CONF['page_size'] = '100000';
2019-05-10 23:21:28 +02:00
?>
'');
cacheDir = config.variables.postfixadminpkgCacheDir;
} );
};
}