mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 17:54:08 -05:00
* Nginx to caddy (#5) Convert all nginx instances to caddy instances, setup acme as well * matrix implemented
41 lines
1,019 B
Nix
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
|
|
'';
|
|
};
|
|
}
|