dotfiles/modules/nixos/services/roundcube/default.nix
2025-10-21 23:10:02 -05:00

55 lines
1,021 B
Nix
Executable file

{
pkgs,
flake,
config,
...
}:
let
inherit (flake.config.services.instances) roundcube web;
service = roundcube;
host = service.domains.address0;
in
{
services = {
roundcube = {
enable = true;
configureNginx = false;
dicts = builtins.attrValues {
inherit (pkgs.aspellDicts)
en
;
};
plugins = [
];
# hostName = host;
database = {
host = web.localhost.address1;
dbname = service.name;
username = "";
passwordFile = config.sops.secrets."${service.name}-pass".path;
};
};
};
sops =
let
sopsPath = secret: {
path = "${service.sops.path0}/${service.name}-${secret}";
owner = "root";
mode = "600";
};
in
{
secrets = builtins.listToAttrs (
map
(secret: {
name = "${service.name}-${secret}";
value = sopsPath secret;
})
[
"pass"
]
);
};
}