Skip to content

Commit ee70e4e

Browse files
committed
feat: create ollama container
Signed-off-by: Reputable2722 <153411261+Reputable2772@users.noreply.github.com>
1 parent 58675e2 commit ee70e4e

3 files changed

Lines changed: 35 additions & 0 deletions

File tree

Config/config.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,16 @@ rec {
336336
envFiles = [ "wud" ];
337337
env = null;
338338
};
339+
ollama = {
340+
dir = null;
341+
envFiles = null;
342+
env = [
343+
"OLLAMA_VULKAN=1"
344+
"OLLAMA_KEEP_ALIVE=10m"
345+
"OLLAMA_NUM_CTX=8192"
346+
"OLLAMA_LOAD_TIMEOUT=15m"
347+
];
348+
};
339349
};
340350
};
341351
guest = { };

Users/WickedWizard/Programs/Selfhosted/Containers/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# ./lidarr.nix
1111
./linkding.nix
1212
# ./navidrome.nix
13+
./ollama.nix
1314
# ./qbittorrent.nix
1415
./syncthing.nix
1516
./vaultwarden.nix
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
config,
3+
config',
4+
lib,
5+
...
6+
}:
7+
let
8+
utils = import ./utils.nix { inherit config config' lib; };
9+
in
10+
{
11+
containers.caddy.services.ollama = "ollama:11434";
12+
13+
programs.quadlets.quadlets."ollama.container" = lib.attrsets.recursiveUpdate {
14+
Container = {
15+
Image = "docker.io/ollama/ollama:latest";
16+
Volume = utils.mapVolume "ollama" [
17+
"data:/root/.ollama"
18+
];
19+
AddDevice = "/dev/dri";
20+
GroupAdd = "keep-groups";
21+
}
22+
// utils.appendEnv "ollama";
23+
} (utils.containerDefaults "ollama" "systemd-caddy");
24+
}

0 commit comments

Comments
 (0)