Ollama : Make a system service.
This commit is contained in:
parent
99ebc1e529
commit
205aa1d24c
|
@ -1,18 +1,18 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
environment.systemPackages = with pkgs; [ ollama ];
|
||||
systemd.user.services.ollama = {
|
||||
systemd.services.ollama = {
|
||||
description = "Ollama LLM server.";
|
||||
wantedBy = [ "default.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "NetworkManager-wait-online.service" ];
|
||||
after = [ "NetworkManager-wait-online.service" ];
|
||||
serviceConfig.Type = "simple";
|
||||
script = ''
|
||||
${lib.getExe pkgs.ollama} serve
|
||||
HOME=/root ${lib.getExe pkgs.ollama} serve
|
||||
'';
|
||||
};
|
||||
systemd.user.services.ollamamodel = {
|
||||
systemd.services.ollamamodel = {
|
||||
description = "Ollama LLM model.";
|
||||
wantedBy = [ "default.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "ollama.service" ];
|
||||
after = [ "ollama.service" ];
|
||||
serviceConfig.Type = "simple";
|
||||
|
|
Reference in a new issue