enforce new flake schema. formatting.
This commit is contained in:
parent
4b0a90e00d
commit
ecf5132cbb
121 changed files with 1606 additions and 1554 deletions
|
|
@ -83,10 +83,43 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
|
||||
oci-containers = {
|
||||
backend = "podman";
|
||||
|
||||
containers."open-webui" = {
|
||||
image = with cfg.image; imageName + ":" + imageTag;
|
||||
imageFile = cfg.image;
|
||||
environment =
|
||||
defaultEnv
|
||||
// cfg.environment
|
||||
// {
|
||||
PORT = "${toString cfg.port}";
|
||||
CORS_ALLOW_ORIGIN = concatStringsSep ";" (
|
||||
[
|
||||
"http://localhost:${toString cfg.port}"
|
||||
"http://127.0.0.1:${toString cfg.port}"
|
||||
"http://0.0.0.0:${toString cfg.port}"
|
||||
]
|
||||
++ optional (cfg.externalUrl != null) cfg.externalUrl
|
||||
);
|
||||
};
|
||||
environmentFiles = optional (cfg.environmentFile != null) cfg.environmentFile;
|
||||
volumes = [
|
||||
"open-webui_open-webui:/app/backend/data:rw"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network=host"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.firewall.interfaces =
|
||||
|
|
@ -97,70 +130,44 @@ in
|
|||
"${matchAll}".allowedUDPPorts = [ 53 ];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.backend = "podman";
|
||||
|
||||
virtualisation.oci-containers.containers."open-webui" = {
|
||||
image = with cfg.image; imageName + ":" + imageTag;
|
||||
imageFile = cfg.image;
|
||||
environment =
|
||||
defaultEnv
|
||||
// cfg.environment
|
||||
// {
|
||||
PORT = "${toString cfg.port}";
|
||||
CORS_ALLOW_ORIGIN = concatStringsSep ";" (
|
||||
[
|
||||
"http://localhost:${toString cfg.port}"
|
||||
"http://127.0.0.1:${toString cfg.port}"
|
||||
"http://0.0.0.0:${toString cfg.port}"
|
||||
]
|
||||
++ optional (cfg.externalUrl != null) cfg.externalUrl
|
||||
);
|
||||
systemd = {
|
||||
services."podman-open-webui" = {
|
||||
serviceConfig = {
|
||||
Restart = mkOverride 90 "always";
|
||||
};
|
||||
environmentFiles = optional (cfg.environmentFile != null) cfg.environmentFile;
|
||||
volumes = [
|
||||
"open-webui_open-webui:/app/backend/data:rw"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network=host"
|
||||
];
|
||||
};
|
||||
systemd.services."podman-open-webui" = {
|
||||
serviceConfig = {
|
||||
Restart = mkOverride 90 "always";
|
||||
after = [
|
||||
"podman-volume-open-webui_open-webui.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-volume-open-webui_open-webui.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-open-webui-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-open-webui-root.target"
|
||||
];
|
||||
};
|
||||
after = [
|
||||
"podman-volume-open-webui_open-webui.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-volume-open-webui_open-webui.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-open-webui-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-open-webui-root.target"
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."podman-volume-open-webui_open-webui" = {
|
||||
path = [ pkgs.podman ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
services."podman-volume-open-webui_open-webui" = {
|
||||
path = [ pkgs.podman ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
script = ''
|
||||
podman volume inspect open-webui_open-webui || podman volume create open-webui_open-webui
|
||||
'';
|
||||
partOf = [ "podman-compose-open-webui-root.target" ];
|
||||
wantedBy = [ "podman-compose-open-webui-root.target" ];
|
||||
};
|
||||
script = ''
|
||||
podman volume inspect open-webui_open-webui || podman volume create open-webui_open-webui
|
||||
'';
|
||||
partOf = [ "podman-compose-open-webui-root.target" ];
|
||||
wantedBy = [ "podman-compose-open-webui-root.target" ];
|
||||
};
|
||||
|
||||
systemd.targets."podman-compose-open-webui-root" = {
|
||||
unitConfig = {
|
||||
Description = "Root target generated by compose2nix.";
|
||||
targets."podman-compose-open-webui-root" = {
|
||||
unitConfig = {
|
||||
Description = "Root target generated by compose2nix.";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue