Installation of a package returns Undefined Variable Error

I have tried to install the ollama package from the nix repository. For some odd reason the installation fails. The build is successful when I comment that line out.

output of nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.3.8, NixOS, 23.11 (Tapir), 23.11.20230617.04af42f`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.15.1`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/store/vby8c3909sglr03fxkclkly29vs49ncy-source`
relevant config file
`{ pkgs, ... }: {
  environment.systemPackages = with pkgs; [
    fira-mono
    bottom
    openssl
    pkg-config
    gcc
    lldb
    black
    clang-tools
    cmake
    nil
    helix
    wget
    ollama
    # tesseract
    gitFull
    # mysql-workbench
  ];
}`
Error Message
error:
       … while calling the 'head' builtin

         at /nix/store/vby8c3909sglr03fxkclkly29vs49ncy-source/lib/attrsets.nix:784:11:

          783|         || pred here (elemAt values 1) (head values) then
          784|           head values
             |           ^
          785|         else

       … while evaluating the attribute 'value'

         at /nix/store/vby8c3909sglr03fxkclkly29vs49ncy-source/lib/modules.nix:759:9:

          758|     in warnDeprecation opt //
          759|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          760|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: undefined variable 'ollama'

       at /nix/store/6mf1fq8hzx814a2dj1bg10bqlyhwgvjq-source/nixos/utils/dev_tools.nix:15:5:

           14|     wget
           15|     ollama
             |     ^
           16|     # tesseract

Looks like you have not updated in the last 6 months… Perhaps that is the reason.

1 Like

I installed nixos on this laptop this morning, how do i go about updating it tho

sudo nix-channel --update if you are using channels.

1 Like

I think that worked! Thank you <3