mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-13 20:41:07 +01:00
ollama: add darwin support
This commit is contained in:
parent
8c0671c513
commit
daf04c5950
8 changed files with 75 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ in {
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.user.services.ollama = {
|
||||
systemd.user.services.ollama = mkIf pkgs.stdenv.isLinux {
|
||||
Unit = {
|
||||
Description = "Server for local large language models";
|
||||
After = [ "network.target" ];
|
||||
|
|
@ -92,6 +92,21 @@ in {
|
|||
Install = { WantedBy = [ "default.target" ]; };
|
||||
};
|
||||
|
||||
launchd.agents.ollama = mkIf pkgs.stdenv.isDarwin {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = [ "${getExe ollamaPackage}" "serve" ];
|
||||
EnvironmentVariables = cfg.environmentVariables // {
|
||||
OLLAMA_HOST = "${cfg.host}:${toString cfg.port}";
|
||||
};
|
||||
KeepAlive = {
|
||||
Crashed = true;
|
||||
SuccessfulExit = false;
|
||||
};
|
||||
ProcessType = "Background";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ ollamaPackage ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue