Move everyting to hel1 except emails

This commit is contained in:
Paul-Henri Froidmont 2024-12-10 11:39:55 +01:00
parent 0d3f1b4afc
commit f18644f8a1
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
18 changed files with 476 additions and 448 deletions

View file

@ -1,6 +1,13 @@
{ pkgs, lib, config, ... }:
let cfg = config.custom.services.roundcube;
in {
{
pkgs,
lib,
config,
...
}:
let
cfg = config.custom.services.roundcube;
in
{
options.custom.services.roundcube = {
enable = lib.mkEnableOption "roundcube";
};
@ -17,16 +24,17 @@ in {
};
};
# Required because roundcube uses psql: https://github.com/NixOS/nixpkgs/blob/46397778ef1f73414b03ed553a3368f0e7e33c2f/nixos/modules/services/mail/roundcube.nix#L247
services.postgresql.package = pkgs.postgresql_15;
services.roundcube = {
enable = true;
plugins = [ "managesieve" ];
dicts = with pkgs.aspellDicts; [ en fr de ];
dicts = with pkgs.aspellDicts; [
en
fr
de
];
hostName = "webmail.banditlair.com";
database = {
host = "10.0.1.11";
host = "127.0.0.1";
username = "roundcube";
dbname = "roundcube";
passwordFile = config.sops.secrets.pgPassFile.path;
@ -35,10 +43,10 @@ in {
extraConfig = ''
# This override is required as a workaround for the nixpkgs config because we need a plain password instead of a pgpass file
$password = file_get_contents('${config.sops.secrets.dbPassword.path}');
$config['db_dsnw'] = 'pgsql://roundcube:' . $password . '@10.0.1.11/roundcube';
$config['db_dsnw'] = 'pgsql://roundcube:' . $password . '@127.0.0.1/roundcube';
$config['default_host'] = 'ssl://mail.banditlair.com:993';
$config['smtp_server'] = 'ssl://%h';
$config['imap_host'] = 'ssl://mail.banditlair.com:993';
$config['smtp_host'] = 'ssl://%h';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['identities_level'] = 0;