add caddy module

This commit is contained in:
ulic-youthlic 2025-01-24 18:35:18 +08:00
parent fd2fe39655
commit 98b594aa15
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
5 changed files with 93 additions and 29 deletions

View file

@ -8,14 +8,30 @@ in
enable = lib.mkEnableOption "open-webui";
};
};
config = lib.mkIf cfg.enable {
services.open-webui = {
enable = true;
port = 8083;
environmentFile = "${config.sops.secrets."open-webui_env".path}";
};
sops.secrets."open-webui_env" = {
format = "yaml";
};
};
config = lib.mkMerge [
(lib.mkIf cfg.enable {
services.open-webui = {
enable = true;
port = 8083;
environmentFile = "${config.sops.secrets."open-webui_env".path}";
};
sops.secrets."open-webui_env" = {
format = "yaml";
};
})
(
let
caddy-cfg = config.youthlic.programs.caddy;
in
lib.mkIf caddy-cfg.enable {
services.caddy.virtualHosts = {
"open-webui.${caddy-cfg.baseDomain}" = {
extraConfig = ''
reverse_proxy 127.0.0.1:8083
'';
};
};
}
)
];
}