mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-21 08:21:24 +02:00
feat(idols-ai): add ollama
This commit is contained in:
3
modules/nixos/desktop/ai/default.nix
Normal file
3
modules/nixos/desktop/ai/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
21
modules/nixos/desktop/ai/ollama.nix
Normal file
21
modules/nixos/desktop/ai/ollama.nix
Normal 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";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user