Ollama: Make pull wait for network.
This commit is contained in:
parent
81d6530047
commit
3b466250f4
|
@ -36,8 +36,6 @@ in
|
||||||
ollama = {
|
ollama = {
|
||||||
description = "Ollama LLM server.";
|
description = "Ollama LLM server.";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
wants = [ "NetworkManager-wait-online.service" ];
|
|
||||||
after = [ "NetworkManager-wait-online.service" ];
|
|
||||||
serviceConfig.Type = "simple";
|
serviceConfig.Type = "simple";
|
||||||
script = ''
|
script = ''
|
||||||
HOME=/root ${getExe pkgs.ollama} serve
|
HOME=/root ${getExe pkgs.ollama} serve
|
||||||
|
@ -48,11 +46,16 @@ in
|
||||||
ollama-pull = {
|
ollama-pull = {
|
||||||
description = "Ollama LLM model.";
|
description = "Ollama LLM model.";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
wants = [ "ollama.service" ];
|
wants = [
|
||||||
after = [ "ollama.service" ];
|
"NetworkManager-wait-online.service"
|
||||||
|
"ollama.service"
|
||||||
|
];
|
||||||
|
after = [
|
||||||
|
"NetworkManager-wait-online.service"
|
||||||
|
"ollama.service"
|
||||||
|
];
|
||||||
serviceConfig.Type = "simple";
|
serviceConfig.Type = "simple";
|
||||||
script = ''
|
script = ''
|
||||||
sleep 5
|
|
||||||
${getExe pkgs.ollama} pull ${concatStringsSep " " cfg.models}
|
${getExe pkgs.ollama} pull ${concatStringsSep " " cfg.models}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue