about summary refs log tree commit diff
path: root/configurations/eonwe/ollama.nix
blob: 45e6179f746c0d5d1e77210128c1d33256f89594 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
  lib,
  ...
}:
{
  ark.directories = [
    "/var/lib/private/open-webui"
    "/var/lib/private/ollama"
  ];

  hm.programs.firefox.profiles.default.bookmarks = [
    {
      name = "Bookmarks Toolbar";
      toolbar = true;
      bookmarks = [
        {
          name = "Ollama";
          url = "http://eonwe.shire.net:11435";
        }
        {
          name = "Open WebUI";
          url = "http://eonwe.shire.net:11436";
        }
      ];
    }
  ];

  services = {
    ollama = {
      enable = true;

      host = "0.0.0.0";
      port = 11434;

      acceleration = "rocm";
      rocmOverrideGfx = "11.0.0";

      environmentVariables.OLLAMA_ORIGINS = lib.concatStringsSep "," [
        "http://eonwe.shire.net:11434"
        "http://eonwe.shire.net:11435"
        "http://eonwe.shire.net:11436"
      ];

      openFirewall = true;
    };

    nextjs-ollama-llm-ui = {
      enable = true;

      hostname = "0.0.0.0";
      port = 11435;

      ollamaUrl = "http://eonwe.shire.net:11434";
    };

    open-webui = {
      enable = true;

      host = "0.0.0.0";
      port = 11436;

      environment = {
        ANONYMIZED_TELEMETRY = "False";
        DO_NOT_TRACK = "True";
        ENABLE_SIGNUP = "False";
        OLLAMA_BASE_URL = "http://eonwe.shire.net:11434";
        SCARF_NO_ANALYTICS = "True";
        WEBUI_AUTH = "False";
        WEBUI_URL = "http://eonwe.shire.net:11436";
      };

      openFirewall = true;
    };
  };
}

Consider giving Nix/NixOS a try! <3