I would dare guess the author just doesn’t know there is a perfectly functional Windows native Ollama release. I was doing the same thing until I realized that it makes no sense because I can just install ollama on Windows and then connect to it from within WSL.
As others have already pointed out if you're going to run Ollama in Windows anyway, why not use the native build? And if you want to use WSL, then I'd suggest using something like LocalAI which gives you a lot more control and support for additional formats (GGML, GGUF, GPTQ, ONNX, etc).
Just to awnser the question why not using windows. Here are some ideas why the author might have used nix instead:
- reproducible (with minor adjustments even on non-WSL systems)
- if you are used to nix, there is not much which beats it in terms of stability, maintainability, upgradability, and fun (?)
- additional services are typically easier to set up like tailscale-acl, used by the author, which uses pulumi under the hood
- despite some downsides (disc speed was an issue when I used it), WSL is surprisingly capable
Given that Ollama runs quite fine on Windows if you have NVIDIA, why such complicated setup?
It would make more sense for AMD I suppose where Ollama's Windows support is lacking compared to Linux.
That said, neat tricks useful for other stuff as well.
it's unclear to me what you gain running ollama in wsl like this compared to switching to a productive native operating system [like nixos] or just installing the windows release of ollama and quietly forgetting about it.
i use nixos.wsl at work to have the same emacs configuration as on my laptop, and that's fine except the windows filesystem performance makes me want to throw the whole system in a dumpster. but on my home gaming machine i have some games that only run on windows so i just installed ollama's windows installer which works with my GPU and installs an autostart entry.
these days the windows box sits in a dark corner on my network with tailscale (again just the windows install), running sunshine too to start steam games on my laptop.
Running models at home seems like a waste of money while at the same time they are currently heavily subsidized in the cloud by dumb money.
Just did the opposite. Decided it’s time for Linux on desktop. Better for programming. Better for AI.
Bet being that I can get most games to work on it - that was the sticking point. (Thanks to Valve I think it’ll work out)
This is great work, it solves an exact problem I too am having. Now I just need to upgrade my 12 year old GPUs to something that can run an LLM.
I love the idea of this flake to run Ollama even on Windows, but just pointing people to your _everything_ flake is going to confuse people and make it look harder than it is to run Ollama on Nix.
If you are using a system-controlling Nix (nix-darwin, NixOS…), it’s as easy as `hardware.services.ollama.enable=true` with maybe adding `.acceleration=“cuda”` to force GPU usage or `host=“0.0.0.0”` to allow connections to Ollama that are not local to your system. In a home-manager situation it is even easier: just include `pkgs.ollama` in your `home.packages`, with an `.override{}` for the same options above. That should be it, really.
I will say that if you have a more complex NixOS setup that patches the kernel or can’t lean on cachix for some reason that using the ollama package takes a long time to compile. My setup at home runs on a 3950X Threadripper and when Ollama compiles it uses all the cores at 99% for about 16 minutes.
Remove windows. And this is amazing.
I've been running an ollama and deepseek in a container in TrueNAS k8s for several months. It's hooked up to my Continue extension in VSCode. I also mix it with cloud hosted "dumb" ones for other tasks like code completion. Ollama deepseek is reserved for heavier chat and code tasks.
It's fast as hell. Though you will need at least two GPUs to divide between ollama and if need something else(display/game/proxmox) to use it.
Nvidia never fixed their sysmem fallback policy for wsl2 though, running on wsl2 rather than native Windows just spell so much performance problems when VRAM overflows
Gaming PC can run Linux to begin with.
Quoting the article:
> I refused to manage a separate Ubuntu box that would need reconfiguring from scratch.
Immediately followed by:
> After hacking away at it for a number of weeks
Hmmm
Oh dear god, just use containers or instead a proper os rather than that disk chewing monstrosity...
Ollama also runs on Windows.
>gaming PC
>LLM
stinky
I agree with the other commenters, this post does not explain why you would not just run Ollama or Koboldcpp on Windows. What exactly makes running Ollama within virtualized NixOS in WSL in some way better than running natively?
If it's just the novelty aspect of it or some idealogical reason, that's fine, but it should be explained in the blog post before someone thinks this is a sane and logical way to run Ollama on a gaming PC.