Compare commits

..

No commits in common. "31f195ff89880846d296495ebf605ef603973943" and "aea241d6103a3502dc57b7259439fb0295dbc416" have entirely different histories.

4 changed files with 8 additions and 76 deletions

View file

@ -9,33 +9,19 @@ View the [*synix* NixOS module on Forgejo](https://git.sid.ovh/sid/synix/tree/ma
- [Homepage](https://openwebui.com/) - [Homepage](https://openwebui.com/)
- [GitHub](https://github.com/open-webui/open-webui) - [GitHub](https://github.com/open-webui/open-webui)
- [Environment Configuration](https://docs.openwebui.com/getting-started/env-configuration/) - [Environment Configuration](https://docs.openwebui.com/getting-started/env-configuration/)
- [Nixpkgs Docker tools](https://github.com/NixOS/nixpkgs/blob/master/doc/build-helpers/images/dockertools.section.md)
## Configuration ## Configuration
```nix ```nix
{ inputs, ... }:
{ {
imports = [ inputs.synix.nixosModules.open-webui-oci ]; imports = [ inputs.synix.nixosModules.open-webui-oci ];
services.open-webui-oci.enable = true; services.open-webui-oci.enable = true;
# You can provide an image to use:
services.open-webui-oci.image = pkgs.dockerTools.pullImage {
imageName = "ghcr.io/open-webui/open-webui";
imageDigest = "sha256:2deb90b0423473d8f97febced2e62b8fd898aa3eb61877bb3aa336370214c258";
hash = "sha256-2cdKfvZGUyPUm7TFXcf5OcG9ey4BvOZPUOVim1S2C+s=";
finalImageName = "ghcr.io/open-webui/open-webui";
finalImageTag = "0.8.5";
};
} }
``` ```
You can use `nix-prefetch-docker` to get the attribute set to pass to `dockerTools.pullImage`:
```bash
nix run nixpkgs#nix-prefetch-docker -- --image-name ghcr.io/open-webui/open-webui --arch amd64 --os linux --image-tag 0.8.5
```
## Usage ## Usage
Visit the web interface at your specified location to create an admin account. Visit the web interface at your specified location to create an admin account.

View file

@ -219,15 +219,6 @@
}; };
in in
testPkgs.testers.runNixOSTest ./tests/run/synapse.nix; testPkgs.testers.runNixOSTest ./tests/run/synapse.nix;
# NOTE: disabled for now since the test takes too long to execute
# open-webui-oci-test =
# let
# testPkgs = import nixpkgs {
# inherit system;
# };
# in
# testPkgs.testers.runNixOSTest ./tests/run/open-webui-oci.nix;
} }
); );

View file

@ -8,14 +8,6 @@
let let
cfg = config.services.open-webui-oci; cfg = config.services.open-webui-oci;
image = pkgs.dockerTools.pullImage {
imageName = "ghcr.io/open-webui/open-webui";
imageDigest = "sha256:2deb90b0423473d8f97febced2e62b8fd898aa3eb61877bb3aa336370214c258";
hash = "sha256-2cdKfvZGUyPUm7TFXcf5OcG9ey4BvOZPUOVim1S2C+s=";
finalImageName = "ghcr.io/open-webui/open-webui";
finalImageTag = "0.8.5";
};
defaultEnv = { defaultEnv = {
ANONYMIZED_TELEMETRY = "False"; ANONYMIZED_TELEMETRY = "False";
BYPASS_MODEL_ACCESS_CONTROL = "True"; BYPASS_MODEL_ACCESS_CONTROL = "True";
@ -50,10 +42,11 @@ 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.";
image = mkOption { version = mkOption {
type = types.package; type = types.str;
default = image; default = "main";
description = "The Docker image to use (`pkgs.dockerTools.pullImage`)."; example = "v0.8.5";
description = "Container version string.";
}; };
externalUrl = mkOption { externalUrl = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
@ -100,8 +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 = with cfg.image; imageName + ":" + imageTag; image = "ghcr.io/open-webui/open-webui:${cfg.version}";
imageFile = cfg.image;
environment = environment =
defaultEnv defaultEnv
// cfg.environment // cfg.environment

View file

@ -1,37 +0,0 @@
let
port = 3000;
in
{
name = "open-webui-oci-test";
nodes.machine =
{ ... }:
{
imports = [
../../modules/nixos/open-webui-oci
];
config = {
virtualisation.diskSize = 32768;
virtualisation.memorySize = 8192;
services.open-webui-oci = {
enable = true;
inherit port;
};
networking.firewall.enable = false;
};
};
testScript = ''
start_all()
machine.wait_for_unit("default.target")
machine.wait_for_unit("podman-open-webui.service")
machine.wait_for_open_port(${toString port})
machine.succeed("curl --fail --retry 10 --retry-delay 5 --retry-connrefused http://localhost:${toString port}/")
'';
}