---
date: "2024-03-15T08:48:25.000Z"
title: "2024-03-15"
tags: ["nix","nix-darwin","home-manager","ollama","launch_daemons"]
draft: false
---

I've spend almost a week, on and off, trying to install `ollama` using Nix in such a way that `ollama serve` will be run and managed automatically in the background.
Initially, I had tried to install `ollama` via `home-manager`.
This was straightforward, but finding a way to have `ollama serve` run automatically so that I didn't need to do it myself every time I wanted to interact with or pull a model.
This need send me down that macOS rabbithole of launch agents/daemons and plists.
The macOS-specific nature of this research could have tipped me off that this was a job for `nix-darwin` rather than `home-manager`.
Eventually, I tried installing `ollama` via `nix-darwin` and it seemed to Just Work.
I still haven't been able to figure out where it's running `ollama serve` from.

```sh
❯ grep -l 'ollama' ~/Library/LaunchAgents/* /Library/LaunchAgents/* /Library/LaunchDaemons/* /System/Library/LaunchAgents/* /System/Library/LaunchDaemons/*

# nothing
```

Nix-darwin appears to have [several options](https://daiderd.com/nix-darwin/manual/index.html#opt-environment.launchDaemons) for configuring launch agents that I may need to return to if this behavior doesn't persist across a restart.

---

I learn about [this game](https://neal.fun/infinite-craft/) by Neal a little while and I love it.
I think it's a language-model-based craft game.
Something like a game I played a long time ago called "Alchemy".