56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
|
{
|
||
|
self,
|
||
|
tree,
|
||
|
inputs,
|
||
|
config,
|
||
|
pkgs,
|
||
|
hostPath,
|
||
|
...
|
||
|
}: let
|
||
|
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
|
||
|
hostIP = containerAddresses.host;
|
||
|
containerIP = containerAddresses.containers.roundcube;
|
||
|
in {
|
||
|
containers.roundcube = {
|
||
|
autoStart = true;
|
||
|
privateNetwork = true;
|
||
|
hostAddress = hostIP;
|
||
|
localAddress = containerIP;
|
||
|
|
||
|
specialArgs = {
|
||
|
inherit inputs;
|
||
|
inherit tree;
|
||
|
inherit self;
|
||
|
inherit hostPath;
|
||
|
};
|
||
|
|
||
|
config = {...}: {
|
||
|
nixpkgs.pkgs = pkgs;
|
||
|
|
||
|
imports = with tree; [
|
||
|
presets.nixos.containerBase
|
||
|
|
||
|
profiles.nginx
|
||
|
profiles.sshd
|
||
|
profiles.firewallAllow.ssh
|
||
|
|
||
|
./profiles/roundcube.nix
|
||
|
];
|
||
|
|
||
|
home-manager.users.root.home.stateVersion = "23.05";
|
||
|
system.stateVersion = "23.05";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
services.nginx = {
|
||
|
enable = true;
|
||
|
virtualHosts."mail.owo.monster" = {
|
||
|
forceSSL = true;
|
||
|
enableACME = true;
|
||
|
locations."/" = {
|
||
|
proxyPass = "http://unix:/var/lib/nixos-containers/roundcube/var/sockets/roundcube.sock";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|