CrOS/modules/services/openhab/default.nix
Crow e0590ff20b
Matrix, Caddy
* Nginx to caddy (#5)

Convert all nginx instances to caddy instances, setup acme as well

* matrix implemented
2025-09-11 14:56:05 -04:00

41 lines
1,019 B
Nix

let
volumePath = "/overseer/services";
in
{
lib,
config,
inputs,
...
}: {
systemd.tmpfiles.rules = [
"d ${volumePath}/openhab"
"d ${volumePath}/openhab/conf"
"d ${volumePath}/openhab/userdata"
"d ${volumePath}/openhab/addons"
];
###########
# Service #
###########
virtualisation.oci-containers = {
backend = "podman";
containers."openhab" = {
image = "openhab/openhab:milestone";
extraOptions = ["--ip=10.88.0.9"];
volumes = [
"${volumePath}/openhab/conf:/openhab/conf"
"${volumePath}/openhab/userdata:/openhab/userdata"
"${volumePath}/openhab/addons:/openhab/addons"
];
};
};
services.caddy = {
enable = true;
virtualHosts."openhab.wanderingcrow.net".extraConfig = ''
@block not remote_ip ${inputs.nix-secrets.network.primary.publicIP} private_ranges
abort @block
reverse_proxy http://10.88.0.9:8080
'';
};
}