Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E005: Unresolved Name

Severity: Warning

unresolved name `pkgs`

A variable name was referenced but could not be found in any enclosing scope. The resulting type is unconstrained (?).

Common causes

  • The binding is defined in a scope that isn’t visible (e.g. a different let block).
  • The name comes from an import or function parameter that tix can’t resolve, such as NixOS module arguments (config, pkgs, lib).
  • Typo in the variable name.

How to fix

  • If it’s a module parameter, configure a context in tix.toml so tix knows the parameter types:
    [context.nixos]
    includes = ["modules/*.nix"]
    stubs = ["@nixos"]
    
  • If it comes from an unresolvable import, add a type annotation:
    /** type: pkgs :: Pkgs */
    pkgs = import <nixpkgs> {};
    
  • Check for typos in the variable name.