How to run ollama service from unstable channel

The question is how to get loadModels to access the unstable channnel? services.ollama.loadModels? may or may not be related)

sudo nix-channel --add  unstablesudo
nix-channel --update
configuration.nix
...
 #https://wiki.nixos.org/wiki/Ollama
  services.ollama = {
    enable = true;
    unstable.loadModels = ["gemma3:27b-it-qat"]; 
    acceleration = "rocm";
  };
  environment.systemPackages = with pkgs; [
...
   unstable.ollama-rocm
...
]; 

I would like to add a feature request to enhance the documenation in https://wiki.nixos.org/wiki/Ollama as most Ollama models are not running with the “stable” version. Any proposals how to file such a request? Thanks.

There is no reason to do this, and it is not possible. The models are defined and pulled from an external service, not a nixpkgs cache.

What errors do you see?

[nixos:~]$ ollama --version
ollama version is 0.12.11
Warning: client version is 0.17.7

In the first line, we have the “stable” version. In the second, it is the “unstable” version due to unstable.ollama-rocm

Set this:

services.ollama.package = unstable.ollama-rocm;

To sum up:

sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable
sudo nix-channel --update

and in configuration.nix

…#https://wiki.nixos.org/wiki/Ollama
services.ollama.package = unstable.ollama-rocm;
services.ollama = {enable = true;
loadModels = [“gemma3:27b-it-qat”];
acceleration = “rocm”;
};
environment.systemPackages = with pkgs; [
…
unstable.ollama-rocm
…
];

You can simplify your configuration.

You do not need to explicitly set environment.systemPackages as the service does it for you.

Also, acceleration is deprecated in nixpkgs-unstable and in nixpkgs-stable it is recommended that you use package instead.

Thus your config becomes this:

services.ollama = {
  enable = true;
  package = unstable.ollama-rocm;
  loadModels = [“gemma3:27b-it-qat”];
};
1 Like

To finally complete sum up:

sudo nix-channel --add https://nixos.org/channels/nixos-unstable unstable
sudo nix-channel --update
configuration.nix:

{ config, pkgs, ... }:

let
  # Import the unstable channel
  unstable = import <unstable> { config = { allowUnfree = true; }; };
in
{

 #https://wiki.nixos.org/wiki/Ollama
  services.ollama = {
    enable = true;
    package = unstable.ollama-rocm;
    loadModels = ["gemma3:27b-it-qat"];
  };

Sorry, the frequently used “preformatted” text option does not seem very user friendly.

Fine. I propose to update https://wiki.nixos.org/wiki/Ollama as this is a very concise and neat way of using an up-to-date version other users will benefit from.

You can switch it in the top left to just use pure markdown.

1 Like

Looking good now :slight_smile: Appreciate the hint.

1 Like

You should be able to make the update yourself if you register for an account with the wiki.