From 5bdecea140af91896fdf31ddef70183a94b12765 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 16 Sep 2025 10:17:14 +0100 Subject: [PATCH] nixos/ollama: add network-online.target to ollama-model-loader.service This should avoid the service failing to start after switching to a new configuration because the network service was restarted. --- nixos/modules/services/misc/ollama.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/ollama.nix b/nixos/modules/services/misc/ollama.nix index d6de23fe4c40..6c45952b8ce7 100644 --- a/nixos/modules/services/misc/ollama.nix +++ b/nixos/modules/services/misc/ollama.nix @@ -270,7 +270,11 @@ in "multi-user.target" "ollama.service" ]; - after = [ "ollama.service" ]; + wants = [ "network-online.target" ]; + after = [ + "ollama.service" + "network-online.target" + ]; bindsTo = [ "ollama.service" ]; environment = config.systemd.services.ollama.environment; serviceConfig = {