feat(idols-ai): add ollama

This commit is contained in:
Ryan Yin
2025-04-30 14:03:21 +08:00
parent 25e1604cda
commit 8c40436e41
5 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}

View File

@@ -0,0 +1,21 @@
{
pkgs,
nixpkgs-ollama,
...
}: let
pkgs-ollama = import nixpkgs-ollama {
inherit (pkgs) system;
# To use cuda, we need to allow the installation of non-free software
config.allowUnfree = true;
};
in {
services.ollama = rec {
enable = true;
package = pkgs-ollama.ollama;
acceleration = "cuda";
host = "127.0.0.1";
port = 11434;
home = "/var/lib/ollama";
models = "${home}/models";
};
}