open-webui: removed network service. add version option #2
1 changed files with 7 additions and 17 deletions
|
|
@ -42,6 +42,12 @@ in
|
||||||
{
|
{
|
||||||
options.services.open-webui-oci = {
|
options.services.open-webui-oci = {
|
||||||
enable = mkEnableOption "Open WebUI container with Podman.";
|
enable = mkEnableOption "Open WebUI container with Podman.";
|
||||||
|
version = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "main";
|
||||||
|
example = "v0.8.5";
|
||||||
|
description = "Container version string.";
|
||||||
|
};
|
||||||
externalUrl = mkOption {
|
externalUrl = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
|
|
@ -87,7 +93,7 @@ in
|
||||||
virtualisation.oci-containers.backend = "podman";
|
virtualisation.oci-containers.backend = "podman";
|
||||||
|
|
||||||
virtualisation.oci-containers.containers."open-webui" = {
|
virtualisation.oci-containers.containers."open-webui" = {
|
||||||
image = "ghcr.io/open-webui/open-webui:main";
|
image = "ghcr.io/open-webui/open-webui:${cfg.version}";
|
||||||
environment =
|
environment =
|
||||||
defaultEnv
|
defaultEnv
|
||||||
// cfg.environment
|
// cfg.environment
|
||||||
|
|
@ -116,11 +122,9 @@ in
|
||||||
Restart = mkOverride 90 "always";
|
Restart = mkOverride 90 "always";
|
||||||
};
|
};
|
||||||
after = [
|
after = [
|
||||||
"podman-network-open-webui_default.service"
|
|
||||||
"podman-volume-open-webui_open-webui.service"
|
"podman-volume-open-webui_open-webui.service"
|
||||||
];
|
];
|
||||||
requires = [
|
requires = [
|
||||||
"podman-network-open-webui_default.service"
|
|
||||||
"podman-volume-open-webui_open-webui.service"
|
"podman-volume-open-webui_open-webui.service"
|
||||||
];
|
];
|
||||||
partOf = [
|
partOf = [
|
||||||
|
|
@ -131,20 +135,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."podman-network-open-webui_default" = {
|
|
||||||
path = [ pkgs.podman ];
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
RemainAfterExit = true;
|
|
||||||
ExecStop = "podman network rm -f open-webui_default";
|
|
||||||
};
|
|
||||||
script = ''
|
|
||||||
podman network inspect open-webui_default || podman network create open-webui_default
|
|
||||||
'';
|
|
||||||
partOf = [ "podman-compose-open-webui-root.target" ];
|
|
||||||
wantedBy = [ "podman-compose-open-webui-root.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services."podman-volume-open-webui_open-webui" = {
|
systemd.services."podman-volume-open-webui_open-webui" = {
|
||||||
path = [ pkgs.podman ];
|
path = [ pkgs.podman ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue