This flake has been mostly abandoned, and won't receive consistent updates. The latest update to ollama version 0.1.32 is only because I haven't updated the version of ollama in nixpkgs due to the rocm build being broken. So, I'm making it available here in the meantime.
A flake for the latest release of ollama. It's purpose is to build the most recent version supporting new models until the version in nixpkgs is updated.
You need to have nix flakes enabled; if you don't, see the nixos wiki for information on flakes and enabling them.
Install ollama to user profile:
nix profile install github:abysssol/ollama-flakeCreate a temporary shell with ollama:
nix shell github:abysssol/ollama-flakeUse as an input in another flake:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
ollama.url = "github:abysssol/ollama-flake";
#ollama.inputs.nixpkgs.follows = "nixpkgs"; # this could break the build unless using unstable nixpkgs
};
outputs = { nixpkgs, ollama, ... }:
let
system = abort "system needs to be set";
# to access the rocm package of the ollama flake:
ollama-rocm = ollama.packages.${system}.rocm;
#ollama-rocm = inputs'.ollama.packages.rocm; # with flake-parts
pkgs = nixpkgs.legacyPackages.${system};
# you can override package inputs like with nixpkgs
ollama-cuda = ollama.packages.${system}.cuda.override { cudaGcc = pkgs.gcc11; };
in
{
# output attributes go here
};
};You can specify a version by appending /<version> after the main url,
where <version> is any branch or tag.
The version branches will only be updated in a backward compatible way, no breaking changes
(see semantic versioning).
Append /3 to follow branch 3 which tracks version 3.y.z of the repo:
nix profile install github:abysssol/ollama-flake/3Use an unchanging tagged version:
nix profile install github:abysssol/ollama-flake/3.0.0Alternate packages can be specified as usual.
From version 3, install the cpu package, which is built to only run on CPU:
nix profile install github:abysssol/ollama-flake/3#cpuOther versions may be available:
nix profile install github:abysssol/ollama-flake/1
nix profile install github:abysssol/ollama-flake/1.7.0Multiple packages are available for the different computation backends supported by ollama on linux. On other platforms (eg darwin), only the default package is available. On darwin, gpu acceleration via metal should work by default.
The available options:
cpu: fallback CPU implementationnix profile install github:abysssol/ollama-flake#cpu
rocm: supported by modern AMD GPUsnix profile install github:abysssol/ollama-flake#rocm
cuda: supported by modern NVIDIA GPUs; uses unfree licensed librariesnix profile install github:abysssol/ollama-flake#cuda
The default builds for cpu:
# both of these are the default package, and are equivalent
nix profile install github:abysssol/ollama-flake
nix profile install github:abysssol/ollama-flake#default
# both of the above are equivalent to the one below
nix profile install github:abysssol/ollama-flake#gpuFind the index of the package to update:
nix profile listUpdate the package at index:
nix profile upgrade $indexIf nix is hesitant to download updates, force nix to download new files with --refresh:
nix profile upgrade --refresh $indexFind the index of the package to remove:
nix profile listRemove the package at index:
nix profile remove $indexThis software is dedicated to the public domain under the Creative Commons Zero. Read the CC0 in the LICENSE file or online.
Any contribution submitted for inclusion in the project is subject to the CC0; that is, it is released into the public domain and all copyright to it is relinquished.