services.ollama: init

This commit is contained in:
陈浩南 2024-07-12 14:23:55 +08:00
parent 135df14fff
commit d48e55e280
2 changed files with 17 additions and 0 deletions

View File

@ -146,6 +146,7 @@ inputs:
memoryMB = 90112;
gpus."4060" = 1;
};
ollama = {};
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
};

View File

@ -0,0 +1,16 @@
inputs:
{
options.nixos.services.ollama = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) ollama; in inputs.lib.mkIf (ollama != null)
{
services =
{
ollama.enable = true;
open-webui =
{ enable = true; package = inputs.pkgs.genericPackages.open-webui; environment.WEBUI_AUTH = "False"; };
nextjs-ollama-llm-ui.enable = true;
};
nixos.packages._packages = [ inputs.pkgs.oterm ];
};
}