depot/cluster/services/soda/host.nix

27 lines
679 B
Nix
Raw Normal View History

2024-07-20 23:13:47 +03:00
{ depot, ... }:
{
containers.soda = {
path = depot.nixosConfigurations.soda.config.system.build.toplevel;
privateNetwork = true;
hostBridge = "vmdefault";
localAddress = "${depot.hours.soda.interfaces.primary.addr}/24";
autoStart = true;
bindMounts.sodaDir = {
hostPath = "/srv/storage/www/soda";
mountPoint = "/soda";
isReadOnly = false;
};
};
systemd.services."container@soda".after = [ "libvirtd.service" "sys-devices-virtual-net-vmdefault.device" ];
networking.nat.forwardPorts = [
{
sourcePort = 52222;
destination = "${depot.hours.soda.interfaces.primary.addr}:22";
proto = "tcp";
}
];
}