add caddy module
This commit is contained in:
parent
fd2fe39655
commit
98b594aa15
5 changed files with 93 additions and 29 deletions
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue